opnsense-ports/sysutils/ods2/files/patch-ods2.c
Franco Fichtner 8576aed609 */*: sync with upstream
Taken from: FreeBSD
2016-03-07 21:15:50 +01:00

15 lines
451 B
C

--- ods2.c.orig 2001-09-07 21:17:04 UTC
+++ ods2.c
@@ -1094,8 +1094,10 @@ int main(int argc,char *argv[])
#ifdef VMS
if (getcmd (str, "$> ") == NULL) break;
#else
- printf("$> ");
- if (gets(str) == NULL) break;
+ printf("$> ");
+ if (fgets(str, sizeof(str), stdin) == NULL)
+ break;
+ str[strlen(str)-1] = '\0'; /* strip newline from str */
#endif
}
ptr = str;