Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/gen PR/21165: Christian Biere: ctype function misuse



details:   https://anonhg.NetBSD.org/src/rev/7fbdc84cfa57
branches:  trunk
changeset: 580272:7fbdc84cfa57
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Apr 17 17:27:11 2005 +0000

description:
PR/21165: Christian Biere: ctype function misuse

diffstat:

 lib/libc/gen/vis.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r 981ff16b5688 -r 7fbdc84cfa57 lib/libc/gen/vis.c
--- a/lib/libc/gen/vis.c        Sun Apr 17 17:22:36 2005 +0000
+++ b/lib/libc/gen/vis.c        Sun Apr 17 17:27:11 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vis.c,v 1.27 2004/02/26 23:01:15 enami Exp $   */
+/*     $NetBSD: vis.c,v 1.28 2005/04/17 17:27:11 christos Exp $        */
 
 /*-
  * Copyright (c) 1989, 1993
@@ -67,7 +67,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: vis.c,v 1.27 2004/02/26 23:01:15 enami Exp $");
+__RCSID("$NetBSD: vis.c,v 1.28 2005/04/17 17:27:11 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -290,7 +290,7 @@
        int flag;
        const char *extra;
 {
-       int c;
+       unsigned char c;
        char *start;
        char *nextra;
        const unsigned char *src = (const unsigned char *)csrc;
@@ -327,14 +327,15 @@
 
 {
        char *extra;
+       unsigned char uc = (unsigned char)c;
 
        _DIAGASSERT(dst != NULL);
 
        MAKEEXTRALIST(flag, extra, "");
        if (flag & VIS_HTTPSTYLE)
-               HVIS(dst, c, flag, nextc, extra);
+               HVIS(dst, uc, flag, nextc, extra);
        else
-               SVIS(dst, c, flag, nextc, extra);
+               SVIS(dst, uc, flag, nextc, extra);
        *dst = '\0';
        return (dst);
 }



Home | Main Index | Thread Index | Old Index