jim 96/05/29 04:46:43
Modified: src Makefile.tmpl mod_imap.c Log: fix sscanf() %n ANSIism and minor lint Revision Changes Path 1.12 +1 -1 apache/src/Makefile.tmpl Index: Makefile.tmpl =================================================================== RCS file: /export/home/cvs/apache/src/Makefile.tmpl,v retrieving revision 1.11 retrieving revision 1.12 diff -C3 -r1.11 -r1.12 *** Makefile.tmpl 1996/05/27 22:34:06 1.11 --- Makefile.tmpl 1996/05/29 11:46:40 1.12 *************** *** 35,41 **** Configuration Configure Makefile.tmpl Makefile *.h *.c # Work around broken compilers ! http_bprintf.o: $(CC) -c $(CFLAGS) $(AUX_CFLAGS) $(BROKEN_BPRINTF_FLAGS) $< #Dependencies --- 35,41 ---- Configuration Configure Makefile.tmpl Makefile *.h *.c # Work around broken compilers ! http_bprintf.o: http_bprintf.c $(CC) -c $(CFLAGS) $(AUX_CFLAGS) $(BROKEN_BPRINTF_FLAGS) $< #Dependencies 1.7 +19 -7 apache/src/mod_imap.c Index: mod_imap.c =================================================================== RCS file: /export/home/cvs/apache/src/mod_imap.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C3 -r1.6 -r1.7 *** mod_imap.c 1996/04/22 09:13:10 1.6 --- mod_imap.c 1996/05/29 11:46:42 1.7 *************** *** 269,275 **** double get_x_coord(char *args) { ! char *endptr = NULL; double x_coord = -1; /* -1 is returned if no coordinate is given */ if (args == NULL) --- 269,275 ---- double get_x_coord(char *args) { ! char *endptr; /* we want it non-null */ double x_coord = -1; /* -1 is returned if no coordinate is given */ if (args == NULL) *************** *** 288,294 **** double get_y_coord(char *args) { ! char *endptr = NULL; char *start_of_y = NULL; double y_coord = -1; /* -1 is returned on error */ --- 288,294 ---- double get_y_coord(char *args) { ! char *endptr; /* we want it non-null */ char *start_of_y = NULL; double y_coord = -1; /* -1 is returned on error */ *************** *** 659,668 **** } /* blank lines and comments are ignored if we aren't printing a menu */ ! if (sscanf(input, "%s %s %n", directive, value, &chars_read) != 2) { continue; /* make sure we read two fields */ } ! string_pos += chars_read; if ( ! strncasecmp(directive, "base", 4 ) ) { /* base, base_uri */ imap_url(r, NULL, value, base); --- 659,674 ---- } /* blank lines and comments are ignored if we aren't printing a menu */ ! if (sscanf(input, "%s %s", directive, value) != 2) { continue; /* make sure we read two fields */ } ! /* Now skip what we just read */ ! while (!(isspace(*string_pos))) /* past directive */ ! string_pos++; ! while (isspace(*string_pos)) /* and whitespace */ ! string_pos++; ! while (!(isspace(*string_pos))) /* and value... have to watch it */ ! string_pos++; /* can have punctuation and stuff */ if ( ! strncasecmp(directive, "base", 4 ) ) { /* base, base_uri */ imap_url(r, NULL, value, base); *************** *** 686,694 **** vertex = 0; while ( vertex < MAXVERTS && ! sscanf(string_pos, "%lf,%lf %n", &pointarray[vertex][X], ! &pointarray[vertex][Y], &chars_read) == 2) { ! string_pos += chars_read; vertex++; } /* so long as there are more vertices to read, and we have room, read them in. We start where we left --- 692,706 ---- vertex = 0; while ( vertex < MAXVERTS && ! sscanf(string_pos, "%lf,%lf", &pointarray[vertex][X], ! &pointarray[vertex][Y]) == 2) { ! while(isspace(*string_pos)) /* past whitespace */ ! string_pos++; ! while(isdigit(*string_pos)) /* and the 1st number */ ! string_pos++; ! string_pos++; /* skip the ',' */ ! while(isdigit(*string_pos)) /* 2nd number */ ! string_pos++; vertex++; } /* so long as there are more vertices to read, and we have room, read them in. We start where we left