harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r774708 - /harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/samsa.c
Date Thu, 14 May 2009 09:40:42 GMT
Author: hindessm
Date: Thu May 14 09:40:42 2009
New Revision: 774708

URL: http://svn.apache.org/viewvc?rev=774708&view=rev
Log:
Fix off-by-one error.

Modified:
    harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/samsa.c

Modified: harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/samsa.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/samsa.c?rev=774708&r1=774707&r2=774708&view=diff
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/samsa.c (original)
+++ harmony/enhanced/jdktools/trunk/modules/samsa/src/main/native/samsa/samsa.c Thu May 14
09:40:42 2009
@@ -462,8 +462,8 @@
     if (dladdr( (const void*)&main, &info) == 0) {
         return NULL;
     }
-    strncpy(buffer, info.dli_fname, PATH_MAX+1);
-    buffer[PATH_MAX+1] = '\0';
+    strncpy(buffer, info.dli_fname, PATH_MAX);
+    buffer[PATH_MAX] = '\0';
 
 #elif defined(WIN32)
     char buffer[512];



Mime
View raw message