gnome-utils/gdialog, 980929 patch: gets -> fgets
- From: Kang-Jin Lee <lee tengu arco de>
- To: gnome-list gnome org
- Subject: gnome-utils/gdialog, 980929 patch: gets -> fgets
- Date: Tue, 29 Sep 1998 18:27:44 +0200
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]