From cb107ace5b31de56f95eddedfce2796dc5ef55ae Mon Sep 17 00:00:00 2001 From: Erik Auerswald Date: Sun, 4 Nov 2012 16:36:43 +0000 Subject: [PATCH] Don't accept -d, --digits 0, as this would result in writing to unallocated memory. --- ssocr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssocr.c b/ssocr.c index 1a514fc..3947ee3 100644 --- a/ssocr.c +++ b/ssocr.c @@ -235,7 +235,7 @@ int main(int argc, char **argv) case 'd': if(optarg) { number_of_digits = atoi(optarg); - if(number_of_digits < 0) { + if(number_of_digits < 1) { fprintf(stderr, "warning: ignoring --number-digits=%s\n", optarg); number_of_digits = NUMBER_OF_DIGITS; }