From 80f3320843fb05ed69a578badb9138c3b0a9feaf Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Wed, 12 Sep 2018 20:02:32 +0200 Subject: [PATCH] Fix codacy warning --- src/runtime.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime.c b/src/runtime.c index 47ac7dd..9848907 100644 --- a/src/runtime.c +++ b/src/runtime.c @@ -730,7 +730,6 @@ int main(int argc, char *argv[]) { mount_dir[templen+8+namelen+6] = 0; // null terminate destination size_t mount_dir_size = strlen(mount_dir); - char filename[mount_dir_size + 8]; /* enough for mount_dir + "/AppRun" */ pid_t pid; char **real_argv; int i; @@ -806,9 +805,6 @@ int main(int argc, char *argv[]) { } close (dir_fd); - strcpy (filename, mount_dir); - strcat (filename, "/AppRun"); - real_argv = malloc (sizeof (char *) * (argc + 1)); for (i = 0; i < argc; i++) { real_argv[i] = argv[i]; @@ -866,6 +862,10 @@ int main(int argc, char *argv[]) { setenv( "OWD", cwd, 1 ); } + char filename[mount_dir_size + 8]; /* enough for mount_dir + "/AppRun" */ + strcpy (3, mount_dir); + strcat (filename, "/AppRun"); + /* TODO: Find a way to get the exit status and/or output of this */ execv (filename, real_argv); /* Error if we continue here */ -- 2.11.4.GIT