Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/citrus corrent an error in previous commit:



details:   https://anonhg.NetBSD.org/src/rev/f5960c728d07
branches:  trunk
changeset: 570152:f5960c728d07
user:      soda <soda%NetBSD.org@localhost>
date:      Sat Sep 25 23:51:31 2004 +0000

description:
corrent an error in previous commit:
don't corrupt return value on error case, pointed out by yamt

diffstat:

 lib/libc/citrus/citrus_ctype_template.h |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 60da78605c89 -r f5960c728d07 lib/libc/citrus/citrus_ctype_template.h
--- a/lib/libc/citrus/citrus_ctype_template.h   Sat Sep 25 22:53:46 2004 +0000
+++ b/lib/libc/citrus/citrus_ctype_template.h   Sat Sep 25 23:51:31 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: citrus_ctype_template.h,v 1.26 2004/09/25 22:53:46 soda Exp $  */
+/*     $NetBSD: citrus_ctype_template.h,v 1.27 2004/09/25 23:51:31 soda Exp $  */
 
 /*-
  * Copyright (c)2002 Citrus Project,
@@ -603,7 +603,8 @@
        err = _FUNCNAME(wcrtomb_priv)(_CEI_TO_EI(_TO_CEI(cl)), s, sz,
                                      wc, psenc, nresult);
 #if _ENCODING_IS_STATE_DEPENDENT
-       *nresult += rsz;
+       if (err == 0)
+               *nresult += rsz;
 quit:
 #endif
        if (err == E2BIG)
@@ -693,7 +694,8 @@
 #endif
        err = _FUNCNAME(wcrtomb_priv)(ei, s, sz, wc, psenc, &nr);
 #if _ENCODING_IS_STATE_DEPENDENT
-       *nresult = (int)(nr + rsz);
+       if (err == 0)
+               *nresult = (int)(nr + rsz);
 #else
        *nresult = (int)nr;
 #endif



Home | Main Index | Thread Index | Old Index