From 1ca6ae71706aa0011633428d90a5021a6c50117c Mon Sep 17 00:00:00 2001 From: froge Date: Thu, 31 Jul 2025 18:55:17 +1000 Subject: [PATCH] use stderr if getline fails --- factorial_examples/factorial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/factorial_examples/factorial.c b/factorial_examples/factorial.c index 7946aef..4d10b61 100644 --- a/factorial_examples/factorial.c +++ b/factorial_examples/factorial.c @@ -25,7 +25,7 @@ int main(void) { fputs("Enter number to factor: ", stdout); int err = getline(&lineptr, &bufsize, stdin); if(err == -1) { - puts("Error reading line from user input"); + fputs("Error reading line from user input\n", stderr); return 1; }