Closed GoogleCodeExporter closed 9 years ago
Same as described in Issue#109. It can be solved by applying the applied patch.
Original comment by olejl77@gmail.com
on 10 Oct 2008 at 4:58
Attachments:
Can you give an example of the wrong string that appears on win32? Issue 109
(on
linux) only applies to strncpy not snprintf.
Original comment by sknau...@wesleyan.edu
on 11 Oct 2008 at 3:24
If I add the following for debugging:
Index: main/romcache.c
===================================================================
--- main/romcache.c (revisjon 1102)
+++ main/romcache.c (arbeidskopi)
@@ -178,6 +178,8 @@
else
{
file = dirfrompath(entry->filename);
+ printf("File: %s - %d\n", file, strlen(file));
+ printf("Path: %s - %d\n", file, strlen(path));
if(strlen(file)==strlen(path)&&strncmp(file, path,
strlen(path))==0)
{
free(file);
My output will then be:
mupen64plus.exe
__ __ __ _ _ ____ _
| \/ |_ _ _ __ ___ _ __ / /_ | || | | _ \| |_ _ ___
| |\/| | | | | '_ \ / _ \ '_ \| '_ \| || |_| |_) | | | | / __|
| | | | |_| | |_) | __/ | | | (_) |__ _| __/| | |_| \__ \
|_| |_|\__,_| .__/ \___|_| |_|\___/ |_| |_| |_|\__,_|___/
|_| http://code.google.com/p/mupen64plus/
Version win-devel
Config Dir: ./
Install Dir: ./
Plugin Dir: ./plugins/
Rescanning rom cache.
File: C:/Emulators/Mupen64plus/trunk/roms/f - 37
Path: C:/Emulators/Mupen64plus/trunk/roms/f - 36
File: C:/Emulators/Mupen64plus/trunk/roms/N - 37
Path: C:/Emulators/Mupen64plus/trunk/roms/N - 36
File: C:/Emulators/Mupen64plus/trunk/roms/p - 37
Path: C:/Emulators/Mupen64plus/trunk/roms/p - 36
File: C:/Emulators/Mupen64plus/trunk/roms/S - 37
Path: C:/Emulators/Mupen64plus/trunk/roms/S - 36
File: C:/Emulators/Mupen64plus/trunk/roms/S - 37
Path: C:/Emulators/Mupen64plus/trunk/roms/S - 36
Scanning... C:/Emulators/Mupen64plus/trunk/roms/
Added ROM: Fire Demo by Lac (PD)
Added ROM: NHL Breakaway 99 (U) [!]
Added ROM: Pong by Oman (PD) [h1C][o1]
Added ROM: Super Mario 64 (U) [!]
Added ROM: Super Smash Bros. (U) [!]
Rom cache up to date. 5 ROMs.
Please let me know if you need more information...
Original comment by olejl77@gmail.com
on 11 Oct 2008 at 6:24
ery odd. Your patch breaks linux functionality. I tried something different in
r1107, please give it a try.
If it still does not work, try adding the following debugs in util.c
char* dirfrompath(const char* string)
{
int stringlength, counter;
char* buffer;
stringlength = strlen(string);
printf("Stringlength: %d\n", stringlength);
for(counter = stringlength; counter > 0; --counter)
{
printf("Counter: %d\n", counter);
if (string[counter-1] == '/')
break;
}
printf("Counter: %d\n", counter);
buffer = (char*)malloc((counter+1)*sizeof(char));
snprintf(buffer, counter+1, "%s", string);
printf("%d %d String: %s\n", counter+1, strlen(buffer), buffer);
return buffer;
}
and show me the output for one string.
Also, what are you using to compile on win32?
Original comment by sknau...@wesleyan.edu
on 11 Oct 2008 at 10:34
Fixed in r1109, confirmed.
Original comment by sknau...@wesleyan.edu
on 12 Oct 2008 at 4:43
Fix verified OK.
Original comment by olejl77@gmail.com
on 12 Oct 2008 at 5:54
Original issue reported on code.google.com by
olejl77@gmail.com
on 10 Oct 2008 at 4:55