Date: Fri, 16 Oct 2015 15:19:36 +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: r289424 - head/sbin/newfs_msdos Message-ID: <201510161519.t9GFJa7G068991@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: emaste Date: Fri Oct 16 15:19:36 2015 New Revision: 289424 URL: https://svnweb.freebsd.org/changeset/base/289424 Log: newfs_msdos: prefer snprintf to sprintf Obtained from: NetBSD Sponsored by: The FreeBSD Foundation Modified: head/sbin/newfs_msdos/mkfs_msdos.c Modified: head/sbin/newfs_msdos/mkfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/mkfs_msdos.c Fri Oct 16 14:55:39 2015 (r289423) +++ head/sbin/newfs_msdos/mkfs_msdos.c Fri Oct 16 15:19:36 2015 (r289424) @@ -585,7 +585,7 @@ int mkfs_msdos(const char *fname, const (u_int)tm->tm_min)); mk4(bsx->exVolumeID, x); mklabel(bsx->exVolumeLabel, o.volume_label ? o.volume_label : "NO NAME"); - sprintf(buf, "FAT%u", fat); + snprintf(buf, sizeof(buf), "FAT%u", fat); setstr(bsx->exFileSysType, buf, sizeof(bsx->exFileSysType)); if (!o.bootstrap) { x1 += sizeof(struct bsx);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510161519.t9GFJa7G068991>