From 35946fb706d6333c5c11663fd0b46c1e9116ae0f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 18 Nov 1999 02:59:57 +0000 Subject: Update. * wcsmbs/wcswidth.c (wcswidth): Don't forget to decrement counter n. --- wcsmbs/wcwidth.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'wcsmbs/wcwidth.h') diff --git a/wcsmbs/wcwidth.h b/wcsmbs/wcwidth.h index 4c561f94d7..b8627c54f0 100644 --- a/wcsmbs/wcwidth.h +++ b/wcsmbs/wcwidth.h @@ -1,5 +1,5 @@ /* Internal header containing implementation of wcwidth() function. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -19,6 +19,7 @@ Boston, MA 02111-1307, USA. */ #include +#include #include "../wctype/cname-lookup.h" /* Array containing width information. */ @@ -33,7 +34,7 @@ internal_wcwidth (wint_t ch) return 0; idx = cname_lookup (ch); - if (idx == ~((size_t) 0)) + if (idx == ~((size_t) 0) || (__ctype32_b[idx] & _ISwprint) == 0) return -1; return (int) __ctype_width[idx]; -- cgit v1.2.3