# | Line 15 | Line 15 | static const char RCSid[] = "$Id$"; | |
---|---|---|
15 | ||
16 | ||
17 | char * | |
18 | < | fgetword(s, n, fp) /* get (quoted) word up to n-1 characters */ |
19 | < | char *s; |
20 | < | int n; |
21 | < | register FILE *fp; |
18 | > | fgetword( /* get (quoted) word up to n-1 characters */ |
19 | > | char *s, |
20 | > | int n, |
21 | > | register FILE *fp |
22 | > | ) |
23 | { | |
24 | int quote = '\0'; | |
25 | register char *cp; | |
26 | register int c; | |
27 | + | /* sanity checks */ |
28 | + | if ((s == NULL) | (n <= 0)) |
29 | + | return(NULL); |
30 | /* skip initial white space */ | |
31 | do | |
32 | c = getc(fp); |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |