makefs: cast snprintf return value to size_t to clear warning

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Ed Maste 2017-05-08 16:34:39 +00:00
parent 48b644192d
commit 243a297a95
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=317944
2 changed files with 3 additions and 3 deletions

View File

@ -846,8 +846,8 @@ ffs_populate_dir(const char *dir, fsnode *root, fsinfo_t *fsopts)
for (cur = root; cur != NULL; cur = cur->next) {
if (cur->child == NULL)
continue;
if (snprintf(path, sizeof(path), "%s/%s", dir, cur->name)
>= sizeof(path))
if ((size_t)snprintf(path, sizeof(path), "%s/%s", dir,
cur->name) >= sizeof(path))
errx(1, "Pathname too long.");
if (! ffs_populate_dir(path, cur->child, fsopts))
return (0);

View File

@ -84,7 +84,7 @@ walk_dir(const char *root, const char *dir, fsnode *parent, fsnode *join)
assert(root != NULL);
assert(dir != NULL);
len = snprintf(path, sizeof(path), "%s/%s", root, dir);
len = (size_t)snprintf(path, sizeof(path), "%s/%s", root, dir);
if (len >= (int)sizeof(path))
errx(1, "Pathname too long.");
if (debug & DEBUG_WALK_DIR)