mktemp->mkstemp and gets->fgets

This commit is contained in:
angelos 1998-04-28 01:53:30 +00:00
parent 176fb18fb3
commit 0b3490f979
3 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,19 @@
*** sq.c.orig Mon Apr 27 21:49:01 1998
--- sq.c Mon Apr 27 21:49:14 1998
***************
*** 83,89 ****
char word[257];
static char prev[257] = "";
! while (gets (word) != NULL)
trunc (word, prev);
return 0;
}
--- 83,89 ----
char word[257];
static char prev[257] = "";
! while (fgets (word, 256, stdin) != NULL)
trunc (word, prev);
return 0;
}

View File

@ -0,0 +1,21 @@
*** ispell.c.orig Mon Apr 27 21:46:38 1998
--- ispell.c Mon Apr 27 21:48:33 1998
***************
*** 835,842 ****
(void) fstat (fileno (infile), &statbuf);
(void) strcpy (tempfile, TEMPNAME);
! if (mktemp (tempfile) == NULL || tempfile[0] == '\0'
! || (outfile = fopen (tempfile, "w")) == NULL)
{
(void) fprintf (stderr, CANT_CREATE,
(tempfile == NULL || tempfile[0] == '\0')
--- 835,842 ----
(void) fstat (fileno (infile), &statbuf);
(void) strcpy (tempfile, TEMPNAME);
! if (((outfile = fdopen (mkstemp(tempfile), "w")) == NULL) ||
! (tempfile[0] == '\0'))
{
(void) fprintf (stderr, CANT_CREATE,
(tempfile == NULL || tempfile[0] == '\0')

View File

@ -0,0 +1,19 @@
*** unsq.c.orig Mon Apr 27 21:50:58 1998
--- unsq.c Mon Apr 27 21:52:20 1998
***************
*** 116,122 ****
wordp = word;
while (same_count--)
*wordp++ = (*prevp++);
! if (gets (wordp) == NULL)
{
(void) fprintf (stderr, UNSQ_C_SURPRISE_EOF);
exit (1);
--- 116,122 ----
wordp = word;
while (same_count--)
*wordp++ = (*prevp++);
! if (fgets (wordp, strlen(wordp), stdin) == NULL)
{
(void) fprintf (stderr, UNSQ_C_SURPRISE_EOF);
exit (1);