gnome-utils/gdialog, 980929 patch: gets -> fgets




Hi,

the compiler/linker complains about unsafe gets() in
gnome-utils/gdialog/guage.c and suggests to use fgets instead.

Patch follows:
----------------------------------
--- gnome-utils/gdialog/guage.c-dist	Thu Sep 24 21:02:04 1998
+++ gnome-utils/gdialog/guage.c	Tue Sep 29 18:16:43 1998
@@ -101,15 +101,15 @@
 
 	if (feof (stdin))
 	    break;
-	gets (buf);
+	fgets (buf, sizeof (buf), stdin);
 	if (buf[0] == 'X') {
 	    /* Next line is percentage */
-	    gets (buf);
+	    fgets (buf, sizeof (buf), stdin);
 	    percent = atoi (buf);
 
 	    /* Rest is message text */
 	    prompt_buf[0] = '\0';
-	    while (strncmp (gets (buf), "XXX", 3))
+	    while (strncmp (fgets (buf, sizeof (buf), stdin), "XXX", 3))
 		strcat (prompt_buf, buf);
 	    prompt = prompt_buf;
 	} else
----------------------------------


-- 
Kang-Jin Lee
lee@arco.met.fu-berlin.de



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]