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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to