From: pwpiwi Date: Mon, 10 Apr 2017 16:39:33 +0000 (+0200) Subject: fix missing terminating 0 in my_executable_directory (thanks @iceman1001). X-Git-Tag: v3.0.0~17 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/4a6bc37e70240643fce872d406c83f566c6291c5?ds=inline;hp=-c fix missing terminating 0 in my_executable_directory (thanks @iceman1001). fix warning about const used twice in get_my_executable_path() and get_my_executable_directory(). --- 4a6bc37e70240643fce872d406c83f566c6291c5 diff --git a/client/proxmark3.c b/client/proxmark3.c index 2ed127a4..98f7880e 100644 --- a/client/proxmark3.c +++ b/client/proxmark3.c @@ -199,12 +199,12 @@ static void dumpAllHelp(int markdown) static char *my_executable_path = NULL; static char *my_executable_directory = NULL; -const char const *get_my_executable_path(void) +const char *get_my_executable_path(void) { return my_executable_path; } -const char const *get_my_executable_directory(void) +const char *get_my_executable_directory(void) { return my_executable_directory; } @@ -219,6 +219,7 @@ static void set_my_executable_path(void) my_executable_path[path_length] = '\0'; my_executable_directory = (char *)malloc(dirname_length + 2); strncpy(my_executable_directory, my_executable_path, dirname_length+1); + my_executable_directory[dirname_length+1] = '\0'; } } } diff --git a/client/proxmark3.h b/client/proxmark3.h index 2d19cf5c..3f7c3004 100644 --- a/client/proxmark3.h +++ b/client/proxmark3.h @@ -17,7 +17,7 @@ #define PROXPROMPT "proxmark3> " void SendCommand(UsbCommand *c); -const char const *get_my_executable_path(void); -const char const *get_my_executable_directory(void); +const char *get_my_executable_path(void); +const char *get_my_executable_directory(void); #endif