Fixed string warnings with gcc 8.1.0.
This commit is contained in:
parent
bbf6bf50f7
commit
94b1d648d1
@ -133,6 +133,7 @@ int menuScan(const char* target) {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
strncpy(me->path, tmp_path, sizeof(me->path)-1);
|
strncpy(me->path, tmp_path, sizeof(me->path)-1);
|
||||||
|
me->path[sizeof(me->path)-1] = 0;
|
||||||
if (menuEntryLoad(me, dp->d_name, shortcut))
|
if (menuEntryLoad(me, dp->d_name, shortcut))
|
||||||
menuAddEntry(me);
|
menuAddEntry(me);
|
||||||
else
|
else
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "invalid_icon_bin.h"
|
#include "invalid_icon_bin.h"
|
||||||
#include "folder_icon_bin.h"
|
#include "folder_icon_bin.h"
|
||||||
|
|
||||||
char rootPath[PATH_MAX];
|
char rootPath[PATH_MAX+8];
|
||||||
|
|
||||||
char *menuGetRootPath() {
|
char *menuGetRootPath() {
|
||||||
return rootPath;
|
return rootPath;
|
||||||
@ -248,14 +248,14 @@ void computeFrontGradient(color_t baseColor, int height) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void menuStartup() {
|
void menuStartup() {
|
||||||
|
char tmp_path[PATH_MAX];
|
||||||
|
|
||||||
#ifdef __SWITCH__
|
#ifdef __SWITCH__
|
||||||
strcpy(rootPath,"sdmc:");
|
strcpy(tmp_path,"sdmc:");
|
||||||
#else
|
#else
|
||||||
getcwd(rootPath, PATH_MAX);
|
getcwd(tmp_path, PATH_MAX);
|
||||||
#endif
|
#endif
|
||||||
sprintf(rootPath,"%s%s%s" , rootPath, DIRECTORY_SEPARATOR, "switch" );
|
snprintf(rootPath, sizeof(rootPath)-1, "%s%s%s", tmp_path, DIRECTORY_SEPARATOR, "switch");
|
||||||
|
|
||||||
menuScan(rootPath);
|
menuScan(rootPath);
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ struct menuEntry_s_tag
|
|||||||
menuEntry_s* next;
|
menuEntry_s* next;
|
||||||
MenuEntryType type;
|
MenuEntryType type;
|
||||||
|
|
||||||
char path[PATH_MAX+1];
|
char path[PATH_MAX+8];
|
||||||
argData_s args;
|
argData_s args;
|
||||||
|
|
||||||
char name[ENTRY_NAMELENGTH+1];
|
char name[ENTRY_NAMELENGTH+1];
|
||||||
|
@ -329,7 +329,8 @@ int loadnro(menuEntry_s *me, int sock, struct in_addr remote) {
|
|||||||
|
|
||||||
sanitisePath(filename);
|
sanitisePath(filename);
|
||||||
|
|
||||||
snprintf(me->path, PATH_MAX, "%s%s%s", menuGetRootPath(), DIRECTORY_SEPARATOR, filename);
|
snprintf(me->path, sizeof(me->path)-1, "%s%s%s", menuGetRootPath(), DIRECTORY_SEPARATOR, filename);
|
||||||
|
me->path[PATH_MAX] = 0;
|
||||||
// make sure it's terminated
|
// make sure it's terminated
|
||||||
me->path[PATH_MAX] = 0;
|
me->path[PATH_MAX] = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user