diff options
author | Ed Maste <emaste@FreeBSD.org> | 2017-05-08 16:34:39 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2017-05-08 16:34:39 +0000 |
commit | 243a297a95d56d69ab7b33e1012f6e5a0ff29d04 (patch) | |
tree | 8d6c9ddbd7b0fc105bddd8036f7e6280d16f00e6 /usr.sbin | |
parent | 48b644192d73be11d54b4b3dcfe255bd1b47884d (diff) | |
download | src-243a297a95d56d69ab7b33e1012f6e5a0ff29d04.tar.gz src-243a297a95d56d69ab7b33e1012f6e5a0ff29d04.zip |
makefs: cast snprintf return value to size_t to clear warning
Sponsored by: The FreeBSD Foundation
Notes
Notes:
svn path=/head/; revision=317944
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/makefs/ffs.c | 4 | ||||
-rw-r--r-- | usr.sbin/makefs/walk.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/makefs/ffs.c b/usr.sbin/makefs/ffs.c index 650237e27468..b2c83161ee7d 100644 --- a/usr.sbin/makefs/ffs.c +++ b/usr.sbin/makefs/ffs.c @@ -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); diff --git a/usr.sbin/makefs/walk.c b/usr.sbin/makefs/walk.c index 27d5352bacb9..ac31aeb8b5f6 100644 --- a/usr.sbin/makefs/walk.c +++ b/usr.sbin/makefs/walk.c @@ -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) |