Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/zaurus/stand/zboot use snprintf



details:   https://anonhg.NetBSD.org/src/rev/43b41d2517b6
branches:  trunk
changeset: 328088:43b41d2517b6
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Mar 26 08:02:38 2014 +0000

description:
use snprintf

diffstat:

 sys/arch/zaurus/stand/zboot/unixcons.c |  5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diffs (19 lines):

diff -r b9b965490e99 -r 43b41d2517b6 sys/arch/zaurus/stand/zboot/unixcons.c
--- a/sys/arch/zaurus/stand/zboot/unixcons.c    Wed Mar 26 08:01:21 2014 +0000
+++ b/sys/arch/zaurus/stand/zboot/unixcons.c    Wed Mar 26 08:02:38 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: unixcons.c,v 1.2 2013/12/01 02:54:53 joerg Exp $       */
+/*     $NetBSD: unixcons.c,v 1.3 2014/03/26 08:02:38 christos Exp $    */
 
 /*
  * Copyright (c) 2009 NONAKA Kimihiro <nonaka%netbsd.org@localhost>
@@ -170,8 +170,7 @@
                        char numbuf[20];
                        int len, j;
 
-                       sprintf(numbuf, "%d ", i);
-                       len = strlen(numbuf);
+                       len = snprintf(numbuf, sizeof(numbuf), "%d ", i);
                        for (j = 0; j < len; j++)
                                numbuf[len + j] = '\b';
                        numbuf[len + j] = '\0';



Home | Main Index | Thread Index | Old Index