Module Name: src Committed By: ozaki-r Date: Fri Mar 28 11:49:40 UTC 2014
Modified Files: src/sys/arch/news68k/stand/boot: boot.c Log Message: Use snprintf instead of sprintf To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/news68k/stand/boot/boot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/news68k/stand/boot/boot.c diff -u src/sys/arch/news68k/stand/boot/boot.c:1.18 src/sys/arch/news68k/stand/boot/boot.c:1.19 --- src/sys/arch/news68k/stand/boot/boot.c:1.18 Wed Aug 25 16:35:02 2010 +++ src/sys/arch/news68k/stand/boot/boot.c Fri Mar 28 11:49:40 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.18 2010/08/25 16:35:02 christos Exp $ */ +/* $NetBSD: boot.c,v 1.19 2014/03/28 11:49:40 ozaki-r Exp $ */ /*- * Copyright (c) 1999 Izumi Tsutsui. All rights reserved. @@ -114,7 +114,7 @@ boot(uint32_t d4, uint32_t d5, uint32_t return; } - sprintf(devname, "%s(%d,%d,%d)", devs[type], ctlr, unit, part); + snprintf(devname, sizeof(devname), "%s(%d,%d,%d)", devs[type], ctlr, unit, part); printf("Booting %s%s\n", devname, netbsd); /* use user specified kernel name if exists */ @@ -128,7 +128,7 @@ boot(uint32_t d4, uint32_t d5, uint32_t loadflag &= ~LOAD_BACKWARDS; for (i = 0; kernels[i]; i++) { - sprintf(file, "%s%s", devname, kernels[i]); + snprintf(file, sizeof(file), "%s%s", devname, kernels[i]); DPRINTF("trying %s...\n", file); fd = loadfile(file, marks, loadflag); if (fd != -1)