comparison mercurial/osutil.c @ 24462:40b05303ac32

osutil: mark end of string with null char, not 0 Noticed this while working on other stuff in the area.
author Siddharth Agarwal <sid0@fb.com>
date Wed, 25 Mar 2015 16:21:58 -0700
parents 05ccfe6763f1
children fa6685ea7ad8
comparison
equal deleted inserted replaced
24461:05ccfe6763f1 24462:40b05303ac32
341 err = fstatat(dfd, ent->d_name, &st, 341 err = fstatat(dfd, ent->d_name, &st,
342 AT_SYMLINK_NOFOLLOW); 342 AT_SYMLINK_NOFOLLOW);
343 #else 343 #else
344 strncpy(fullpath + pathlen + 1, ent->d_name, 344 strncpy(fullpath + pathlen + 1, ent->d_name,
345 PATH_MAX - pathlen); 345 PATH_MAX - pathlen);
346 fullpath[PATH_MAX] = 0; 346 fullpath[PATH_MAX] = '\0';
347 err = lstat(fullpath, &st); 347 err = lstat(fullpath, &st);
348 #endif 348 #endif
349 if (err == -1) { 349 if (err == -1) {
350 /* race with file deletion? */ 350 /* race with file deletion? */
351 if (errno == ENOENT) 351 if (errno == ENOENT)