about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDaniel Santos <dacs.git@brilhante.top>2022-03-13 14:28:09 +0000
committerDaniel Santos <dacs.git@brilhante.top>2022-03-13 14:28:09 +0000
commit428eecbdcb68543adacf8d091f6c0793db91d61e (patch)
tree13874f867a3e65bdab1046602b5bd8ded747f564
parentf44be5f3b46244e66e728238585d3691dae6281d (diff)
downloadnumericx-c-428eecbdcb68543adacf8d091f6c0793db91d61e.tar.gz
better invalid numeral error message
 * invalid numeral error message now indicates which numerals are valid

Signed-off-by: Daniel Santos <dacs.git@brilhante.top>
-rw-r--r--numericx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/numericx.c b/numericx.c
index 287b6d0..bf853ba 100644
--- a/numericx.c
+++ b/numericx.c
@@ -230,9 +230,10 @@ main(int argc, char* argv[])
 	/* Check if number belongs to it's numerical system */
 	if( !is_valid_number(from, number) )
 	{
+		fprintf(stderr, "error: %s: %s.\nValid numerals are: \"%s\"\n",
+				PROG_NAME, strerror(EDOM), from);
 		free(from);
 		free(to);
-		fprintf(stderr, "error: %s: %s.\n", PROG_NAME, strerror(EDOM));
 		exit(EDOM);
 	}