Module Name: src
Committed By: christos
Date: Wed Mar 26 17:54:46 UTC 2014
Modified Files:
src/sys/arch/hpc/hpc/platid_gen: gram.y platid_gen.c
Log Message:
kill sprintf
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hpc/hpc/platid_gen/gram.y
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hpc/hpc/platid_gen/platid_gen.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/hpc/hpc/platid_gen/gram.y
diff -u src/sys/arch/hpc/hpc/platid_gen/gram.y:1.4 src/sys/arch/hpc/hpc/platid_gen/gram.y:1.5
--- src/sys/arch/hpc/hpc/platid_gen/gram.y:1.4 Fri Sep 23 10:14:38 2011
+++ src/sys/arch/hpc/hpc/platid_gen/gram.y Wed Mar 26 13:54:46 2014
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: gram.y,v 1.4 2011/09/23 14:14:38 nonaka Exp $ */
+/* $NetBSD: gram.y,v 1.5 2014/03/26 17:54:46 christos Exp $ */
/*-
* Copyright (c) 1999
@@ -184,7 +184,7 @@ dump_node(prefix, n)
char prefix2[1024];
node_t *np;
- sprintf(prefix2, "%s ", prefix);
+ snprintf(prefix2, sizeof(prefix2), "%s ", prefix);
switch (n->type) {
case N_LABEL:
Index: src/sys/arch/hpc/hpc/platid_gen/platid_gen.c
diff -u src/sys/arch/hpc/hpc/platid_gen/platid_gen.c:1.10 src/sys/arch/hpc/hpc/platid_gen/platid_gen.c:1.11
--- src/sys/arch/hpc/hpc/platid_gen/platid_gen.c:1.10 Fri Sep 23 10:14:38 2011
+++ src/sys/arch/hpc/hpc/platid_gen/platid_gen.c Wed Mar 26 13:54:46 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: platid_gen.c,v 1.10 2011/09/23 14:14:38 nonaka Exp $ */
+/* $NetBSD: platid_gen.c,v 1.11 2014/03/26 17:54:46 christos Exp $ */
/*-
* Copyright (c) 1999
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: platid_gen.c,v 1.10 2011/09/23 14:14:38 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: platid_gen.c,v 1.11 2014/03/26 17:54:46 christos Exp $");
#include <stdio.h>
#include <stdlib.h>
@@ -307,7 +307,7 @@ gen_list(node_t* np)
case N_ENTRY:
if (np->ptr2 == NULL) {
char buf[MAXLEN];
- sprintf(buf, "%s%s",
+ snprintf(buf, sizeof(buf), "%s%s",
nest == 0 ? "" : " ",
np->ptr1);
np->ptr2 = strdup(buf);