From b35663155a20bcff21b00da7d8eb2b6c6a57b075 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 5 Jan 2024 23:02:50 +0100 Subject: [PATCH] neutrino: fix compiler warning warning: 'void* __builtin_memcpy(void*, const void*, unsigned int)' accessing 2147483640 or more bytes at offsets 0 and 0 overlaps 2147483633 bytes at offset 7 [-Wrestrict] Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b7d3d02cc561bcaf2a942e4277695cb621e022c1 Author: vanhofen Date: 2024-01-05 (Fri, 05 Jan 2024) Origin message was: ------------------ - neutrino: fix compiler warning warning: 'void* __builtin_memcpy(void*, const void*, unsigned int)' accessing 2147483640 or more bytes at offsets 0 and 0 overlaps 2147483633 bytes at offset 7 [-Wrestrict] ------------------ This commit was generated by Migit --- src/neutrino.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 683be978b..d19d7b568 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -239,6 +239,7 @@ CNeutrinoFonts * neutrinoFonts = NULL; // I don't like globals, I would have hidden them in classes, // but if you wanna do it so... ;) bool parentallocked = false; + static char **global_argv; extern const char * locale_real_names[]; /* #include */ @@ -2551,7 +2552,7 @@ void CNeutrinoApp::CmdParser(int argc, char **argv) { global_argv = new char *[argc+1]; for (int i = 0; i < argc; i++) - global_argv[i] = argv[i]; + global_argv[i] = strdup(argv[i]); global_argv[argc] = NULL; sections_debug = 1; @@ -5573,6 +5574,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) for(int i = 3; i < 256; i++) close(i); + execvp(global_argv[0], global_argv); // no return if successful exit(CNeutrinoApp::EXIT_REBOOT); // should never be reached