diff options
author | ache <ache@FreeBSD.org> | 1997-12-17 00:13:49 +0800 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1997-12-17 00:13:49 +0800 |
commit | 3c10a30183d1c8ed5db74fcbbef538229c1b0172 (patch) | |
tree | 79fa20b6eb26fd80fe41afe1e3dbc55cc7fecb5f /textproc | |
parent | 878b5861750eb29e02d6eae22e4a05d35078aa6a (diff) | |
download | freebsd-ports-gnome-3c10a30183d1c8ed5db74fcbbef538229c1b0172.tar.gz freebsd-ports-gnome-3c10a30183d1c8ed5db74fcbbef538229c1b0172.tar.zst freebsd-ports-gnome-3c10a30183d1c8ed5db74fcbbef538229c1b0172.zip |
Remove warning: gets -> fgets
Diffstat (limited to 'textproc')
-rw-r--r-- | textproc/ispell/files/patch-ac | 37 | ||||
-rw-r--r-- | textproc/ispell/files/patch-ad | 57 |
2 files changed, 94 insertions, 0 deletions
diff --git a/textproc/ispell/files/patch-ac b/textproc/ispell/files/patch-ac new file mode 100644 index 000000000000..57d5f3955220 --- /dev/null +++ b/textproc/ispell/files/patch-ac @@ -0,0 +1,37 @@ +*** sq.c.orig Tue Jan 25 21:32:18 1994 +--- sq.c Tue Dec 16 19:02:22 1997 +*************** +*** 49,54 **** +--- 49,55 ---- + */ + + #include <stdio.h> ++ #include <string.h> + + #ifdef __STDC__ + #define P(x) x +*************** +*** 82,90 **** + { + char word[257]; + static char prev[257] = ""; + +! while (gets (word) != NULL) + trunc (word, prev); + return 0; + } + +--- 83,95 ---- + { + char word[257]; + static char prev[257] = ""; ++ char *s; + +! while (fgets (word, sizeof(word), stdin) != NULL) { +! if ((s = strchr(word, '\n')) != NULL) +! *s = '\0'; + trunc (word, prev); ++ } + return 0; + } + diff --git a/textproc/ispell/files/patch-ad b/textproc/ispell/files/patch-ad new file mode 100644 index 000000000000..759a070f2caf --- /dev/null +++ b/textproc/ispell/files/patch-ad @@ -0,0 +1,57 @@ +*** unsq.c.bak Tue Jan 25 21:32:18 1994 +--- unsq.c Tue Dec 16 19:08:44 1997 +*************** +*** 49,54 **** +--- 49,55 ---- + */ + + #include <stdio.h> ++ #include <string.h> + #include "msgs.h" + + #ifdef __STDC__ +*************** +*** 99,104 **** +--- 100,107 ---- + register char * prevp; + register int same_count; + register int count_char; ++ int wsize; ++ char *s; + + count_char = getchar (); + if (count_char == EOF) +*************** +*** 114,126 **** + } + prevp = prev; + wordp = word; +! while (same_count--) + *wordp++ = (*prevp++); +! if (gets (wordp) == NULL) + { + (void) fprintf (stderr, UNSQ_C_SURPRISE_EOF); + exit (1); + } + (void) strcpy (prev, word); + return 0 ; + } +--- 117,134 ---- + } + prevp = prev; + wordp = word; +! wsize = 257; +! while (same_count--) { + *wordp++ = (*prevp++); +! wsize--; +! } +! if (fgets (wordp, wsize, stdin) == NULL) + { + (void) fprintf (stderr, UNSQ_C_SURPRISE_EOF); + exit (1); + } ++ if ((s = strchr(wordp, '\n')) != NULL) ++ *s = '\0'; + (void) strcpy (prev, word); + return 0 ; + } |