From dbdbfa2c22e3543804477461944ce536eecb3c7e Mon Sep 17 00:00:00 2001 From: mrg Date: Mon, 23 Oct 2006 04:13:51 +0000 Subject: [PATCH] since register_t is sometimes unsigned, cast to (long) to check >= 0. --- usr.bin/kdump/kdump.c | 8 ++++---- usr.bin/ktruss/dump.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index 883d29d84130..909bde97113c 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -1,4 +1,4 @@ -/* $NetBSD: kdump.c,v 1.86 2006/09/23 22:01:04 manu Exp $ */ +/* $NetBSD: kdump.c,v 1.87 2006/10/23 04:13:51 mrg Exp $ */ /*- * Copyright (c) 1988, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\n\ #if 0 static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: kdump.c,v 1.86 2006/09/23 22:01:04 manu Exp $"); +__RCSID("$NetBSD: kdump.c,v 1.87 2006/10/23 04:13:51 mrg Exp $"); #endif #endif /* not lint */ @@ -508,7 +508,7 @@ ktrsyscall(struct ktr_syscall *ktr) } else if (strcmp(sys_name, "ptrace") == 0 && argcount >= 1) { putchar('('); if (strcmp(emul->name, "linux") == 0) { - if (*ap >= 0 && *ap < + if ((long)*ap >= 0 && *ap < sizeof(linux_ptrace_ops) / sizeof(linux_ptrace_ops[0])) (void)printf("%s", @@ -516,7 +516,7 @@ ktrsyscall(struct ktr_syscall *ktr) else output_long((long)*ap, 1); } else { - if (*ap >= 0 && *ap < + if ((long)*ap >= 0 && *ap < sizeof(ptrace_ops) / sizeof(ptrace_ops[0])) (void)printf("%s", ptrace_ops[*ap]); #ifdef PT_MACHDEP_STRINGS diff --git a/usr.bin/ktruss/dump.c b/usr.bin/ktruss/dump.c index 6bd505638f93..eb32e49673bd 100644 --- a/usr.bin/ktruss/dump.c +++ b/usr.bin/ktruss/dump.c @@ -1,4 +1,4 @@ -/* $NetBSD: dump.c,v 1.26 2006/10/22 16:20:39 christos Exp $ */ +/* $NetBSD: dump.c,v 1.27 2006/10/23 04:21:51 mrg Exp $ */ /*- * Copyright (c) 1988, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\n\ #if 0 static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95"; #endif -__RCSID("$NetBSD: dump.c,v 1.26 2006/10/22 16:20:39 christos Exp $"); +__RCSID("$NetBSD: dump.c,v 1.27 2006/10/23 04:21:51 mrg Exp $"); #endif /* not lint */ #include @@ -545,7 +545,7 @@ syscallprint(struct ktr_header *kth) break; case SYS_ptrace : - if (*ap >= 0 && + if ((long)*ap >= 0 && *ap < sizeof(ptrace_ops) / sizeof(ptrace_ops[0])) wprintf("(%s", ptrace_ops[*ap]); else