[PATCH] osutil: mark end of string with null char, not 0

Siddharth Agarwal sid0 at fb.com
Wed Mar 25 18:24:38 CDT 2015


# HG changeset patch
# User Siddharth Agarwal <sid0 at fb.com>
# Date 1427325718 25200
#      Wed Mar 25 16:21:58 2015 -0700
# Node ID faaf10908909e475e5ae1446061a3d27b8355ee1
# Parent  98042b0e19f9a04be3270cecb07915eac3a515cf
osutil: mark end of string with null char, not 0

Noticed this while working on other stuff in the area.

diff --git a/mercurial/osutil.c b/mercurial/osutil.c
--- a/mercurial/osutil.c
+++ b/mercurial/osutil.c
@@ -337,7 +337,7 @@
 #else
 			strncpy(fullpath + pathlen + 1, ent->d_name,
 				PATH_MAX - pathlen);
-			fullpath[PATH_MAX] = 0;
+			fullpath[PATH_MAX] = '\0';
 			err = lstat(fullpath, &st);
 #endif
 			if (err == -1) {


More information about the Mercurial-devel mailing list