about summary refs log tree commit diff
path: root/wcsmbs/wcswidth.c
diff options
context:
space:
mode:
Diffstat (limited to 'wcsmbs/wcswidth.c')
-rw-r--r--wcsmbs/wcswidth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wcsmbs/wcswidth.c b/wcsmbs/wcswidth.c
index 2828b800da..78fc427276 100644
--- a/wcsmbs/wcswidth.c
+++ b/wcsmbs/wcswidth.c
@@ -1,4 +1,4 @@
-/* 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 <drepper@gnu.ai.mit.edu>, 1996.
 
@@ -26,7 +26,7 @@ wcswidth (const wchar_t *s, size_t n)
 {
   int result = 0;
 
-  while (n > 0 && *s != L'\0')
+  while (n-- > 0 && *s != L'\0')
     {
       int now = internal_wcwidth (*s);
       if (now == -1)