about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDaniel Santos <dacs.git@brilhante.top>2022-03-19 07:43:14 +0000
committerDaniel Santos <dacs.git@brilhante.top>2022-03-19 07:43:14 +0000
commitf5421e76128a30138b0298e2ec29ad5a0f07249c (patch)
tree63ac833f2199e75a211f7112be84bd9efe14f375
parentfcc6c957bfb391b675b3f251a28ec988e31ff50c (diff)
downloadnumericx-c-f5421e76128a30138b0298e2ec29ad5a0f07249c.tar.gz
replace PROG_NAME with "numericx" literal
 * replaced PROG_NAME for string literal "numericx".
 * deleted macro definition of PROG_NAME.

Signed-off-by: Daniel Santos <dacs.git@brilhante.top>
-rw-r--r--cli.c10
-rw-r--r--numericx.c2
-rw-r--r--numericx.h1
3 files changed, 6 insertions, 7 deletions
diff --git a/cli.c b/cli.c
index be77bcc..8ccf3dd 100644
--- a/cli.c
+++ b/cli.c
@@ -111,7 +111,7 @@ main(int argc, char* argv[])
 	/* argument processing */
 	if( !(argc == 2) )
 	{
-		fprintf(stderr, "usage: %s <number>\n", PROG_NAME);
+		fprintf(stderr, "usage: %s <number>\n", "numericx");
 		return E2BIG;
 	}
 
@@ -144,19 +144,19 @@ main(int argc, char* argv[])
 	{
 		case EINVAL:
 			fprintf(stderr, "error: %s: %s. Resulting string argument value has to be NULL.\n",
-					PROG_NAME, strerror(EINVAL));
+					"numericx", strerror(EINVAL));
 			break;
 		case EDOM:
 			fprintf(stderr, "error: %s: %s. Valid numerals are: \"%s\".\n",
-					PROG_NAME, strerror(EDOM), from);
+					"numericx", strerror(EDOM), from);
 			break;
 		case ERANGE:
-				fprintf(stderr, "error: %s: Unrepresentable void number.\n", PROG_NAME);
+				fprintf(stderr, "error: %s: Unrepresentable void number.\n", "numericx");
 			break;
 	}
 	if( !(status == true) )
 	{
-		fprintf(stderr, "error: %s: Incapable of translating.\n", PROG_NAME);
+		fprintf(stderr, "error: %s: Incapable of translating.\n", "numericx");
 		free(from);
 		free(to);
 		numericx_free(result);
diff --git a/numericx.c b/numericx.c
index 306c6cf..5c70012 100644
--- a/numericx.c
+++ b/numericx.c
@@ -30,7 +30,7 @@ new_digit(numeral_ptr* last_numeral, char const* to_first)
 	numeral_ptr* new_numeral = malloc(sizeof(numeral_ptr));
 	if(new_numeral == NULL)
 	{
-		fprintf(stderr, "error: %s: %s!", PROG_NAME, strerror(ENOMEM));
+		fprintf(stderr, "error: %s: %s!", "numericx", strerror(ENOMEM));
 		return NULL;
 	}
 
diff --git a/numericx.h b/numericx.h
index 0a9a399..6870710 100644
--- a/numericx.h
+++ b/numericx.h
@@ -6,7 +6,6 @@
 
 #include <stdbool.h>
 
-#define PROG_NAME "numericx"
 
 /* ||DATA STRUCTURE|| */