From 5700238509f9d77b74b3571cce6f6927b8d86538 Mon Sep 17 00:00:00 2001 From: fedir Date: Wed, 11 Jun 2025 20:16:34 +0200 Subject: [PATCH] Fixed dialog arguments error. --- src/gui/icfs_dialogue.c | 4 ++-- src/ui-socket.c | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/gui/icfs_dialogue.c b/src/gui/icfs_dialogue.c index fb68803..c45db4b 100644 --- a/src/gui/icfs_dialogue.c +++ b/src/gui/icfs_dialogue.c @@ -119,7 +119,7 @@ static int on_command_line(GApplication *app, GApplicationCommandLine *cmdline, argv = g_application_command_line_get_arguments(cmdline, &argc); // Handle your arguments here - if (argc >= 4) { + if (argc >= 5) { fprintf(stderr, "%s\n", argv[1]); g_object_set_data_full(G_OBJECT(app), "accessing_pid", g_strdup(argv[1]), g_free); @@ -145,7 +145,7 @@ int main(int argc, char **argv) { return 0; } - if (argc != 4) { + if (argc != 5) { fprintf(stdout, "Usage: icfs_dialogue [accessing pid] [accessing name] " "[root folder] [access dir]"); return 255; diff --git a/src/ui-socket.c b/src/ui-socket.c index 6a0ab71..6bc51b6 100644 --- a/src/ui-socket.c +++ b/src/ui-socket.c @@ -146,9 +146,6 @@ struct dialogue_response ask_access(const char *filename, push(&dialogue_output, '/'); } - // Validate string length consistency - assert(strlen(first(&dialogue_output)) == size(&dialogue_output)); - // Allocate and copy final filename response.filename = malloc(size(&dialogue_output) + 1); strcpy(response.filename, first(&dialogue_output));