Fixed off-by-one error in findBinaryInPath() (thanks, Dmitry!).
authorRyan C. Gordon <icculus@icculus.org>
Tue, 16 Jul 2013 12:51:54 -0400
changeset 1333 baecd71ae0e7
parent 1332 e0dbcd5e50b9
child 1334 8214ccf21d36
Fixed off-by-one error in findBinaryInPath() (thanks, Dmitry!). This bug is new to the development branch, and doesn't exist in either the stable-1.0 or stable-2.0 branches.
docs/CREDITS.txt
src/platform_unix.c
--- a/docs/CREDITS.txt	Fri Nov 30 14:37:37 2012 -0500
+++ b/docs/CREDITS.txt	Tue Jul 16 12:51:54 2013 -0400
@@ -133,6 +133,9 @@
 SLB archiver:
     Aleksi Nurmi
 
+Bug fixes:
+    Dmitry Marakasov
+
 Other stuff:
     Your name here! Patches go to icculus@icculus.org ...
 
--- a/src/platform_unix.c	Fri Nov 30 14:37:37 2012 -0500
+++ b/src/platform_unix.c	Tue Jul 16 12:51:54 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 */