From 9390979ffdd716dc47efb092383aae91b0292685 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Tue, 17 Mar 2015 12:10:38 +0000 Subject: [PATCH] factor: fix the mess Grumble --- Applications/util/factor.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Applications/util/factor.c b/Applications/util/factor.c index fa11197c..631f99ad 100644 --- a/Applications/util/factor.c +++ b/Applications/util/factor.c @@ -26,6 +26,7 @@ config FACTOR #include #include #include +#include static void factor(char *s) { @@ -77,10 +78,12 @@ static void factor(char *s) l /= ll; } } - putc(stderr,'\n'); + putc('\n', stderr); } } +#define LINE_MAX 256 + int main(int argc,char *argv[]) { if (argc > 1) { @@ -88,10 +91,9 @@ int main(int argc,char *argv[]) for (ss = argv; *ss; ss++) factor(*ss); } else for (;;) { - char *s = 0; - size_t len = 0; + char s[LINE_MAX]; - if (-1 == gets_s(&s, LINE_MAX)) break; + if (NULL == gets_s(s, LINE_MAX)) break; factor(s); } } -- 2.34.1