commit f998270e72e814bd147bc23613441adfda654f54
parent df83b1464032ec380b8589dc604e31d573a64259
Author: Martin J. Klöckner <64109770+klewer-martin@users.noreply.github.com>
Date: Thu, 26 Nov 2020 00:09:44 -0300
Update ex23_imp.c
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/95.11/guia03/ex23_imp.c b/95.11/guia03/ex23_imp.c
@@ -15,9 +15,10 @@ int main ( void ) {
if(fgets(buffer, MAX_LEN, stdin) == NULL)
return 1;
-// Converts the input str to int;
+// Converts the input str to int, if the number
+// is negative, puts an error message on stderr;
if((num = atoi(buffer)) < 0 ) {
- fprintf(stderr, ERR_MSG_LEN"\n");
+ fprintf(stderr, ERR_MSG_NEG"\n");
return 1;
}