Source-Changes-HG archive

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

[src/trunk]: src/lib/libcurses fix 8bit cleanness of getch() and wgetch(). n...



details:   https://anonhg.NetBSD.org/src/rev/2c7647e30c96
branches:  trunk
changeset: 495563:2c7647e30c96
user:      itojun <itojun%NetBSD.org@localhost>
date:      Mon Jul 31 16:22:46 2000 +0000

description:
fix 8bit cleanness of getch() and wgetch().  never use char variable against
stdio functions which return "int" (including getchar()).
the bug was introduced in 1.9 -> 1.10.  fixes PR10723.

diffstat:

 lib/libcurses/getch.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 771e5bce791d -r 2c7647e30c96 lib/libcurses/getch.c
--- a/lib/libcurses/getch.c     Mon Jul 31 14:59:15 2000 +0000
+++ b/lib/libcurses/getch.c     Mon Jul 31 16:22:46 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getch.c,v 1.29 2000/05/25 06:46:26 jdc Exp $   */
+/*     $NetBSD: getch.c,v 1.30 2000/07/31 16:22:46 itojun Exp $        */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)getch.c    8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: getch.c,v 1.29 2000/05/25 06:46:26 jdc Exp $");
+__RCSID("$NetBSD: getch.c,v 1.30 2000/07/31 16:22:46 itojun Exp $");
 #endif
 #endif                                 /* not lint */
 
@@ -674,8 +674,8 @@
 int
 wgetch(WINDOW *win)
 {
-       int     inp, weset;
-       char    c;
+       int inp, weset;
+       int c;
 
        if (!(win->flags & __SCROLLOK) && (win->flags & __FULLWIN)
            && win->curx == win->maxx - 1 && win->cury == win->maxy - 1
@@ -742,7 +742,7 @@
                        clearerr(stdin);
                        inp = ERR;
                } else {
-                       inp = (unsigned int) c;
+                       inp = c;
                }
        }
 #ifdef DEBUG



Home | Main Index | Thread Index | Old Index