newfs_msdos: prefer snprintf to sprintf

Obtained from:	NetBSD
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Ed Maste 2015-10-16 15:19:36 +00:00
parent d8f3dc7871
commit 59faa1e9fb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=289424

View file

@ -585,7 +585,7 @@ int mkfs_msdos(const char *fname, const char *dtype,
(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);