Module Name: src Committed By: christos Date: Wed Mar 26 17:43:11 UTC 2014
Modified Files: src/sys/arch/newsmips/stand/boot: boot.c src/sys/arch/newsmips/stand/bootxx: bootxx.c Log Message: kill sprintf To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/newsmips/stand/boot/boot.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/newsmips/stand/bootxx/bootxx.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/newsmips/stand/boot/boot.c diff -u src/sys/arch/newsmips/stand/boot/boot.c:1.19 src/sys/arch/newsmips/stand/boot/boot.c:1.20 --- src/sys/arch/newsmips/stand/boot/boot.c:1.19 Sat Jan 22 14:19:21 2011 +++ src/sys/arch/newsmips/stand/boot/boot.c Wed Mar 26 13:43:11 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.19 2011/01/22 19:19:21 joerg Exp $ */ +/* $NetBSD: boot.c,v 1.20 2014/03/26 17:43:11 christos Exp $ */ /*- * Copyright (C) 1999 Tsubai Masanari. All rights reserved. @@ -147,7 +147,8 @@ boot(uint32_t a0, uint32_t a1, uint32_t _rtt(); } - 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); @@ -165,7 +166,7 @@ boot(uint32_t a0, uint32_t a1, uint32_t marks[MARK_START] = 0; 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) Index: src/sys/arch/newsmips/stand/bootxx/bootxx.c diff -u src/sys/arch/newsmips/stand/bootxx/bootxx.c:1.8 src/sys/arch/newsmips/stand/bootxx/bootxx.c:1.9 --- src/sys/arch/newsmips/stand/bootxx/bootxx.c:1.8 Thu Feb 21 09:32:31 2008 +++ src/sys/arch/newsmips/stand/bootxx/bootxx.c Wed Mar 26 13:43:11 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: bootxx.c,v 1.8 2008/02/21 14:32:31 tsutsui Exp $ */ +/* $NetBSD: bootxx.c,v 1.9 2014/03/26 17:43:11 christos Exp $ */ /*- * Copyright (C) 1999 Tsubai Masanari. All rights reserved. @@ -108,7 +108,8 @@ bootxx(uint32_t a0, uint32_t a1, uint32_ printf("unknown bootdev (0x%x)\n", bootdev); 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); fd = rom_open(devname, 0); }