summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--direct-append.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/direct-append.c b/direct-append.c
index bf18c72..af7efb4 100644
--- a/direct-append.c
+++ b/direct-append.c
@@ -55,8 +55,10 @@ int main(int argc, char *argv[])
}
n_chars = strtoul(argv[2], NULL, 0);
- if (n_chars <= 0)
+ if (n_chars <= 0) {
+ fprintf(stderr, "Invalid number of characters: %d\n", n_chars);
n_chars = DEFAULT_N_CHARS;
+ }
str = malloc(n_chars * sizeof(char));