- int len;\r
- len = plat_get_root_dir(cfg, 512);\r
- strncpy(cfg + len, PicoConfigFile, 512-6-1-len);\r
+ int pos, end_len;\r
+\r
+ end_len = strlen(end);\r
+ pos = plat_get_root_dir(buff, size);\r
+ strncpy(buff + pos, end, size - pos);\r
+ buff[size - 1] = 0;\r
+ if (pos + end_len > size - 1)\r
+ lprintf("Warning: path truncated: %s\n", buff);\r
+}\r
+\r
+static void make_config_cfg(char *cfg_buff_512)\r
+{\r
+ emu_make_path(cfg_buff_512, PicoConfigFile, 512-6);\r