aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/cmd_line.c
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-05-13 11:34:49 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-05-13 11:37:46 +0200
commitdcf1149af6f8a0c71271a44b9aa1b06a5b4b45c5 (patch)
tree52d28b110c66c601bc23dda09f1aa6cc53d820de /src/cmd_line.c
parentcommand: refactoring (diff)
downloadcimple-dcf1149af6f8a0c71271a44b9aa1b06a5b4b45c5.tar.gz
cimple-dcf1149af6f8a0c71271a44b9aa1b06a5b4b45c5.zip
use -std=c17 -Wpedantic
Diffstat (limited to 'src/cmd_line.c')
-rw-r--r--src/cmd_line.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd_line.c b/src/cmd_line.c
index 8651831..7f437d1 100644
--- a/src/cmd_line.c
+++ b/src/cmd_line.c
@@ -13,12 +13,12 @@
#include <stdlib.h>
#include <string.h>
-static char *get_current_binary_path()
+static char *get_current_binary_path(void)
{
return my_readlink("/proc/self/exe");
}
-static char *get_current_binary_name()
+static char *get_current_binary_name(void)
{
char *path = get_current_binary_path();
if (!path)
@@ -46,7 +46,7 @@ void exit_with_usage(int ec)
char *binary = get_current_binary_name();
- fprintf(dest, "usage: %s %s\n", binary ?: "prog", get_usage_string());
+ fprintf(dest, "usage: %s %s\n", binary ? binary : "prog", get_usage_string());
free(binary);
exit(ec);
}
@@ -58,11 +58,11 @@ void exit_with_usage_err(const char *msg)
exit_with_usage(1);
}
-void exit_with_version()
+void exit_with_version(void)
{
char *binary = get_current_binary_name();
- printf("%s %s\n", binary ?: "prog", VERSION);
+ printf("%s %s\n", binary ? binary : "prog", VERSION);
free(binary);
exit(0);
}