summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2009-01-26 23:24:15 +0100
committerTobias Klauser <tklauser@distanz.ch>2009-01-26 23:24:15 +0100
commit256053718479dfce4d8469dea1cd66bb17842509 (patch)
tree1337f7a846c7db69893a94b4abffb3aa4e312b8e
parentb6850a9e3cd988829e5d09918928ef5aa9b4e731 (diff)
Print error on invalid n_chars
-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));