From 45bed6684dba85b27aec0314b1480daae9c7835c Mon Sep 17 00:00:00 2001 From: Bryan Cantrill Date: Wed, 9 Mar 2011 09:02:25 -0800 Subject: 781 overrun in fgetws Reviewed by: Garrett D'Amore Reviewed by: Gordon Ross Approved by: Garrett D'Amore --- usr/src/lib/libc/port/locale/fgetws.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr/src') diff --git a/usr/src/lib/libc/port/locale/fgetws.c b/usr/src/lib/libc/port/locale/fgetws.c index e209023141..11340600ab 100644 --- a/usr/src/lib/libc/port/locale/fgetws.c +++ b/usr/src/lib/libc/port/locale/fgetws.c @@ -1,5 +1,5 @@ /* - * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2002-2004 Tim J. Robbins. * All rights reserved. * @@ -63,7 +63,7 @@ _fgetws_impl(wchar_t *_RESTRICT_KYWD ws, int n, FILE *_RESTRICT_KYWD fp, } wsp = ws; - while (n--) { + while (--n) { wc = _fgetwc_unlocked(fp); if (wc == EOF) { /* -- cgit v1.2.3