# HG changeset patch # User Dmitry Marakasov # Date 1387999428 -14400 # Node ID a3fe81c3bc022d032ba60cf087d3ed82f0833965 # Parent 1fdc1507e42db9ac09136d3024e25c11f128b26d Fix off-by-one in physfs This change was integrated into physfs upstream as baecd71ae0e7 diff -r 1fdc1507e42d -r a3fe81c3bc02 misc/libphysfs/platform_unix.c --- a/misc/libphysfs/platform_unix.c Sun Dec 15 14:05:42 2013 -0500 +++ b/misc/libphysfs/platform_unix.c Wed Dec 25 23:23:48 2013 +0400 @@ -193,7 +193,7 @@ if (access(exe, X_OK) == 0) /* Exists as executable? We're done. */ { - exe[size - binlen] = '\0'; /* chop off filename, leave '/' */ + exe[size - binlen - 1] = '\0'; /* chop off filename, leave '/' */ return exe; } /* if */