Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/m68k/m68k Fix hexstr() for -Wwritable-strings.



details:   https://anonhg.NetBSD.org/src/rev/3f49afdb6038
branches:  trunk
changeset: 581547:3f49afdb6038
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Thu Jun 02 14:29:02 2005 +0000

description:
Fix hexstr() for -Wwritable-strings.

diffstat:

 sys/arch/m68k/m68k/regdump.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r 8a41d37a3d27 -r 3f49afdb6038 sys/arch/m68k/m68k/regdump.c
--- a/sys/arch/m68k/m68k/regdump.c      Thu Jun 02 14:24:26 2005 +0000
+++ b/sys/arch/m68k/m68k/regdump.c      Thu Jun 02 14:29:02 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: regdump.c,v 1.9 2005/05/17 04:14:57 christos Exp $     */
+/*     $NetBSD: regdump.c,v 1.10 2005/06/02 14:29:02 tsutsui Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: regdump.c,v 1.9 2005/05/17 04:14:57 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: regdump.c,v 1.10 2005/06/02 14:29:02 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -168,8 +168,10 @@
        static char nbuf[9];
        register int x, i;
 
-       if (len > 8)
-               return("");
+       if (len > 8) {
+               nbuf[0] = '\0';
+               return(nbuf);
+       }
        nbuf[len] = '\0';
        for (i = len-1; i >= 0; --i) {
                x = val & 0xF;



Home | Main Index | Thread Index | Old Index