aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-02 12:41:44 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-02 12:41:44 +0300
commit0070c5bac9a19235160fef52acafe66879dc2730 (patch)
tree255ee412936a7b9500934a8e9143ca8ce196877f /src/main.c
parentbf12e23d26107b1c8139ca7f3e55cd7edd29b7ba (diff)
downloadcgit_auth-0070c5bac9a19235160fef52acafe66879dc2730.tar.gz
cgit_auth-0070c5bac9a19235160fef52acafe66879dc2730.tar.bz2
cgit_auth-0070c5bac9a19235160fef52acafe66879dc2730.zip
upd: try add arg's positions into log string
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 22a4320..287de53 100644
--- a/src/main.c
+++ b/src/main.c
@@ -19,9 +19,21 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}
+ str = "[0] ";
strcpy(str, argv[0]);
- for (int i = 1; i < argc; i++)
- strcat(str, argv[i]);
+ for (int i = 1; i < argc; i++) {
+ char *tmp = NULL;
+
+ if ((tmp = malloc(strlen(argv[i]) + 4)) == NULL) {
+ perror("main: malloc failed");
+ exit(EXIT_FAILURE);
+ }
+
+ sprintf(tmp, "[%d] %s", i, argv[i]);
+ strcat(str, tmp);
+
+ free(tmp);
+ }
syslog(LOG_DEBUG, "args: %s\n", str);