Date: Mon, 8 May 2017 16:34:39 +0000 (UTC) From: Ed Maste <emaste@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317944 - head/usr.sbin/makefs Message-ID: <201705081634.v48GYdVg026237@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: emaste Date: Mon May 8 16:34:39 2017 New Revision: 317944 URL: https://svnweb.freebsd.org/changeset/base/317944 Log: makefs: cast snprintf return value to size_t to clear warning Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/makefs/ffs.c head/usr.sbin/makefs/walk.c Modified: head/usr.sbin/makefs/ffs.c ============================================================================== --- head/usr.sbin/makefs/ffs.c Mon May 8 16:06:20 2017 (r317943) +++ head/usr.sbin/makefs/ffs.c Mon May 8 16:34:39 2017 (r317944) @@ -846,8 +846,8 @@ ffs_populate_dir(const char *dir, fsnode 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); Modified: head/usr.sbin/makefs/walk.c ============================================================================== --- head/usr.sbin/makefs/walk.c Mon May 8 16:06:20 2017 (r317943) +++ head/usr.sbin/makefs/walk.c Mon May 8 16:34:39 2017 (r317944) @@ -84,7 +84,7 @@ walk_dir(const char *root, const char *d 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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705081634.v48GYdVg026237>