Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/kdump Fix formatting of ktr_user entries so that val...



details:   https://anonhg.NetBSD.org/src/rev/1a972f4651a2
branches:  trunk
changeset: 534849:1a972f4651a2
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Aug 04 14:26:21 2002 +0000

description:
Fix formatting of ktr_user entries so that values of individual bytes
of ktrace record are treated as unsigned char, and printed using "%02x".
Change suggested in bin/17832 by Paul Goyette.

diffstat:

 usr.bin/kdump/kdump.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (34 lines):

diff -r b46e5d753585 -r 1a972f4651a2 usr.bin/kdump/kdump.c
--- a/usr.bin/kdump/kdump.c     Sun Aug 04 14:13:49 2002 +0000
+++ b/usr.bin/kdump/kdump.c     Sun Aug 04 14:26:21 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kdump.c,v 1.39 2002/06/20 22:02:32 atatat Exp $        */
+/*     $NetBSD: kdump.c,v 1.40 2002/08/04 14:26:21 jdolecek Exp $      */
 
 /*-
  * Copyright (c) 1988, 1993
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)kdump.c    8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.39 2002/06/20 22:02:32 atatat Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.40 2002/08/04 14:26:21 jdolecek Exp $");
 #endif
 #endif /* not lint */
 
@@ -611,12 +611,12 @@
        int len;
 {
        int i;
-       char *dta;
+       unsigned char *dta;
 
        printf("\"%.*s: %d, ", KTR_USER_MAXIDLEN, usr->ktr_id, len);
-       dta = (char *)usr;
+       dta = (unsigned char *)usr;
        for(i=sizeof(struct ktr_user); i < len; i++)
-               printf("%x", dta[i]);
+               printf("%02x", (unsigned int) dta[i]);
        printf("\"\n");
 }
 



Home | Main Index | Thread Index | Old Index