aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--numericx.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/numericx.c b/numericx.c
index 792a4c3..87cde70 100644
--- a/numericx.c
+++ b/numericx.c
@@ -97,6 +97,13 @@ main(int argc, char* argv[])
{
program_name = argv[0];
+ /* argument processing */
+ if( !(argc == 2) )
+ {
+ fprintf(stderr, "usage: %s <number>\n", program_name);
+ exit(EXIT_FAILURE);
+ }
+
/* Numeral System variables from MACROS */
char* from = malloc( (strlen(FROM_NUMERICALS) + 1) * sizeof(char) );
char* to = malloc( (strlen(TO_NUMERICALS) + 1) * sizeof(char) );