diff options
author | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2007-07-18 05:04:42 +0000 |
---|---|---|
committer | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2007-07-18 05:04:42 +0000 |
commit | 20144326c064f4a17ec07a35f95b8c11431d5cfe (patch) | |
tree | 3b04005986b56011a52969f97c48e9fc8e22cf24 /ACE/apps | |
parent | 4f1a20c2b61f5f8eb1192b3838bc1b39579525e6 (diff) | |
download | ATCD-20144326c064f4a17ec07a35f95b8c11431d5cfe.tar.gz |
Wed Jul 18 05:02:49 UTC 2007 Abdullah Sowayan <abdullah.sowayan@lmco.com>
Diffstat (limited to 'ACE/apps')
-rw-r--r-- | ACE/apps/JAWS/clients/WebSTONE/src/bench.c | 4 | ||||
-rw-r--r-- | ACE/apps/JAWS/clients/WebSTONE/src/genrand.c | 64 | ||||
-rw-r--r-- | ACE/apps/JAWS/clients/WebSTONE/src/getopt.c | 4 | ||||
-rw-r--r-- | ACE/apps/JAWS/clients/WebSTONE/src/gettimeofday.c | 7 | ||||
-rw-r--r-- | ACE/apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/http.h | 3 | ||||
-rw-r--r-- | ACE/apps/JAWS/clients/WebSTONE/src/sysdep.h | 2 | ||||
-rw-r--r-- | ACE/apps/JAWS/clients/WebSTONE/src/webmaster.c | 26 |
7 files changed, 60 insertions, 50 deletions
diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/bench.c b/ACE/apps/JAWS/clients/WebSTONE/src/bench.c index 54e6147ba4d..2849c1c3dfd 100644 --- a/ACE/apps/JAWS/clients/WebSTONE/src/bench.c +++ b/ACE/apps/JAWS/clients/WebSTONE/src/bench.c @@ -39,8 +39,8 @@ void *mymalloc(size_t size) { void *ptr; ptr = malloc(size); - if (ptr == NULL) - errexit("Call to malloc() failed\n"); + if (ptr == 0) + errexit("Call to malloc() failed\n"); return ptr; } diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/genrand.c b/ACE/apps/JAWS/clients/WebSTONE/src/genrand.c index 65f54fbc839..58291d5063b 100644 --- a/ACE/apps/JAWS/clients/WebSTONE/src/genrand.c +++ b/ACE/apps/JAWS/clients/WebSTONE/src/genrand.c @@ -23,40 +23,46 @@ void main(const int argc, char* argv[]) { - FILE* file; - int i; - int my_random; - int size; - char *cp; - - if (argc != 3) { - printf("usage: %s file_size_in_bytes[K|M] name\n", argv[0]); - exit(2); - } + FILE* file; + int i; + int my_random; + int size; + char *cp; - if ((file = fopen(argv[2], "w")) == NULL) { - perror("fopen"); - exit(1); + if (argc != 3) + { + printf("usage: %s file_size_in_bytes[K|M] name\n", argv[0]); + exit(2); } - size = atoi(argv[1]); - for (cp = argv[1]; *cp; cp++) { - switch(*cp) { - case 'k': - case 'K': - size *= 1024; - break; - case 'm': - case 'M': - size *= 1024*1024; - break; - } + if ((file = fopen(argv[2], "w")) == 0) + { + perror("fopen"); + exit(1); } - for (i = 0; i < size; i++) { - my_random = ((RANDOM() % 94) + 33); - fputc((char)my_random, file); + size = atoi(argv[1]); + + for (cp = argv[1]; *cp; cp++) + { + switch(*cp) + { + case 'k': + case 'K': + size *= 1024; + break; + case 'm': + case 'M': + size *= 1024*1024; + break; + } + } + + for (i = 0; i < size; i++) + { + my_random = ((RANDOM() % 94) + 33); + fputc((char)my_random, file); } - fclose(file); + fclose(file); } diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/getopt.c b/ACE/apps/JAWS/clients/WebSTONE/src/getopt.c index fc0bbe7037a..d04ea469aa6 100644 --- a/ACE/apps/JAWS/clients/WebSTONE/src/getopt.c +++ b/ACE/apps/JAWS/clients/WebSTONE/src/getopt.c @@ -38,7 +38,7 @@ char **argv, *opts; return(EOF); } optopt = c = argv[optind][sp]; - if(c == ':' || (cp=strchr(opts, c)) == NULL) { + if(c == ':' || (cp=strchr(opts, c)) == 0) { ERR(": unknown option, -", c); if(argv[optind][++sp] == '\0') { optind++; @@ -61,7 +61,7 @@ char **argv, *opts; sp = 1; optind++; } - optarg = NULL; + optarg = 0; } return(c); } diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/gettimeofday.c b/ACE/apps/JAWS/clients/WebSTONE/src/gettimeofday.c index 7c685ad90c5..dbe4e1d0d63 100644 --- a/ACE/apps/JAWS/clients/WebSTONE/src/gettimeofday.c +++ b/ACE/apps/JAWS/clients/WebSTONE/src/gettimeofday.c @@ -34,9 +34,10 @@ int gettimeofday(curTimeP) { struct _timeb localTime; - if (curTimeP == (struct timeval *) NULL) { - errno = EFAULT; - return (-1); + if (curTimeP == (struct timeval *) 0) + { + errno = EFAULT; + return (-1); } /* diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/http.h b/ACE/apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/http.h index b247b3805b8..8fa5d0bd608 100644 --- a/ACE/apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/http.h +++ b/ACE/apps/JAWS/clients/WebSTONE/src/nsapi-includes/frame/http.h @@ -116,12 +116,13 @@ int http_start_response(Session *sn, Request *rq); char **http_hdrs2env(pblock *pb); - +//FUZZ: disable check_for_NULL /* * http_status sets status to the code n, with reason string r. If r is * NULL, the server will attempt to find one for the given status code. * If it finds none, it will give "Because I felt like it." */ +//FUZZ: enable check_for_NULL #define protocol_status http_status void http_status(Session *sn, Request *rq, int n, char *r); diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/sysdep.h b/ACE/apps/JAWS/clients/WebSTONE/src/sysdep.h index 8e89da433c2..6dcb23e4a18 100644 --- a/ACE/apps/JAWS/clients/WebSTONE/src/sysdep.h +++ b/ACE/apps/JAWS/clients/WebSTONE/src/sysdep.h @@ -30,10 +30,12 @@ #define MAXHOSTNAMELEN 64 #endif +//FUZZ: disable check_for_NULL /* SunOS doesn't define NULL */ #ifndef NULL #define NULL 0 #endif +//FUZZ: enable check_for_NULL /* encapsulation of minor UNIX/WIN NT differences */ #ifdef WIN32 diff --git a/ACE/apps/JAWS/clients/WebSTONE/src/webmaster.c b/ACE/apps/JAWS/clients/WebSTONE/src/webmaster.c index b6d595ce32d..57464bc3018 100644 --- a/ACE/apps/JAWS/clients/WebSTONE/src/webmaster.c +++ b/ACE/apps/JAWS/clients/WebSTONE/src/webmaster.c @@ -230,7 +230,7 @@ void echo_client(void *stream) for (i = 0; i < num_rexecs; i++) if (sockarr[i] != BADSOCKET_VALUE) FD_SET(sockarr[i], &readfds); - rv = select(num_rexecs, &readfds, NULL, NULL, &timeout); + rv = select(num_rexecs, &readfds, 0, 0, &timeout); if ( rv == 0) continue; if (rv < 0 && WSAGetLastError() == WSANOTINITIALISED) @@ -300,13 +300,13 @@ int i; /* we have an IP address */ client_addr = inet_addr(client_hostname); if (client_addr == INADDR_NONE) - return NULL; + return 0; } else { /* we have a hostname, use the webserver hostname */ return master_phe->h_name; } - for (i = 0; master_phe->h_addr_list[i] != NULL; i++) { + for (i = 0; master_phe->h_addr_list[i] != 0; i++) { if ((*(int *)(master_phe->h_addr_list[i]) & netmask) == (client_addr & netmask)) goto gotit; @@ -653,12 +653,12 @@ struct sockaddr_in *serveraddr; * ITS VALIDITY AND THEN rexec A COMMAND ON THE CLIENT. */ - if ((fp = fopen(configfile,"r")) == NULL) + if ((fp = fopen(configfile,"r")) == 0) { errexit("Could not open config file %s\n", configfile); } - if ((inetport = getservbyname("exec","tcp")) == NULL) + if ((inetport = getservbyname("exec","tcp")) == 0) { errexit("Could not get service name for exec/tcp\n"); } @@ -674,7 +674,7 @@ struct sockaddr_in *serveraddr; int num; char *primename; - if (NULL == fgets(linebuf, sizeof(linebuf), fp)) + if (0 == fgets(linebuf, sizeof(linebuf), fp)) break; num = sscanf(linebuf,"%s %s %s %d %s",clienthostname[cnt],login,password, &numclients, webserver2); @@ -696,7 +696,7 @@ struct sockaddr_in *serveraddr; totalnumclients += numclients; primename = pick_webmaster_IP_address(clienthostname[cnt], master_phe, network_mask); - if (primename == NULL) { + if (primename == 0) { errexit("Bad client address %s for Client %d\n", clienthostname[cnt], cnt); } @@ -808,7 +808,7 @@ int sock; /* if we're hung, quit */ D_PRINTF("Before select() on listen() socket\n"); - if (!(rv = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout))) { + if (!(rv = select(FD_SETSIZE, &readfds, 0, 0, &timeout))) { fprintf(stdout, "Listen timeout after %d seconds (%d clients so far)\n", MAX_ACCEPT_SECS, cnt); @@ -817,7 +817,7 @@ int sock; } } - if(BADSOCKET(socknum[cnt] = accept(sock, NULL, 0))) + if(BADSOCKET(socknum[cnt] = accept(sock, 0, 0))) { /* * ERROR accepting FROM THE CLIENTS. WE NEED TO ISSUE AN @@ -1073,7 +1073,7 @@ stats_t statarray[MAXCLIENTS]; * DONE READING RESULTS FROM CLIENTS */ - *endtime = time(NULL); + *endtime = time(0); timestr = asctime(localtime(endtime)); fprintf(stdout,"\nAll clients ended at %s\n",timestr); fflush(stdout); @@ -1364,7 +1364,7 @@ main(const int argc, char *argv[]) */ - gettimeofday (&sumedh_start, NULL); + gettimeofday (&sumedh_start, 0); SendGo( totalnumclients, socknum); /* @@ -1373,7 +1373,7 @@ main(const int argc, char *argv[]) * INFORMATION WE USE. */ - starttime = time(NULL); + starttime = time(0); timestr = asctime(localtime(&starttime)); fprintf(stdout,"All clients started at %s\n",timestr); fprintf(stdout,"Waiting for clients completion\n"); @@ -1387,7 +1387,7 @@ main(const int argc, char *argv[]) GetResults( &fdset, page_stats, &endtime, timestr, totalnumclients, statarray); - gettimeofday (&sumedh_end, NULL); + gettimeofday (&sumedh_end, 0); PrintResults( page_stats, endtime, timestr, totalnumclients, statarray, page_stats_total); |