Fixed dialog arguments error.

This commit is contained in:
fedir 2025-06-11 20:16:34 +02:00
parent b3e71d13aa
commit 5700238509
Signed by: fedir
GPG Key ID: C959EE85F0C9362C
2 changed files with 2 additions and 5 deletions

View File

@ -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;

View File

@ -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));