35 lines
908 B
Text
35 lines
908 B
Text
$NetBSD: patch-ad,v 1.3 2000/11/10 00:40:35 wiz Exp $
|
|
|
|
--- guage.c.orig Sat Aug 12 00:54:52 1995
|
|
+++ guage.c
|
|
@@ -38,6 +38,11 @@
|
|
char prompt_buf[1024];
|
|
WINDOW *dialog;
|
|
|
|
+ if (height < 0 || width < 0) {
|
|
+ fprintf(stderr, "\nAutosizing is impossible in dialog_textbox().\n");
|
|
+ return(-1);
|
|
+ }
|
|
+
|
|
/* center dialog box on screen */
|
|
x = (COLS - width) / 2;
|
|
y = (LINES - height) / 2;
|
|
@@ -86,15 +91,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
|