From: Alan Cox Date: Tue, 17 Mar 2015 12:10:38 +0000 (+0000) Subject: factor: fix the mess X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=9390979ffdd716dc47efb092383aae91b0292685;p=FUZIX.git factor: fix the mess Grumble --- 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); } }