CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: maya Date: Mon Jun 11 20:28:23 UTC 2018 Modified Files: src/lib/libc/citrus/modules: citrus_mapper_std.c Log Message: Avoid left-shifting a negative number in the non-compat case, too. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/lib/libc/citrus/modules/citrus_mapper_std.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_mapper_std.c diff -u src/lib/libc/citrus/modules/citrus_mapper_std.c:1.11 src/lib/libc/citrus/modules/citrus_mapper_std.c:1.12 --- src/lib/libc/citrus/modules/citrus_mapper_std.c:1.11 Mon Jun 11 18:03:38 2018 +++ src/lib/libc/citrus/modules/citrus_mapper_std.c Mon Jun 11 20:28:23 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_mapper_std.c,v 1.11 2018/06/11 18:03:38 kamil Exp $ */ +/* $NetBSD: citrus_mapper_std.c,v 1.12 2018/06/11 20:28:23 maya Exp $ */ /*- * Copyright (c)2003, 2006 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_mapper_std.c,v 1.11 2018/06/11 18:03:38 kamil Exp $"); +__RCSID("$NetBSD: citrus_mapper_std.c,v 1.12 2018/06/11 20:28:23 maya Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -216,7 +216,7 @@ rowcol_parse_variable(struct _citrus_map rc->rc_dst_unit_bits = be32toh(rcx->rcx_dst_unit_bits); m = be32toh(rcx->rcx_src_rowcol_bits); - n = 1 << (m - 1); + n = 1U << (m - 1); n |= n - 1; rc->rc_src_rowcol_bits = m; rc->rc_src_rowcol_mask = n;
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: kamil Date: Mon Jun 11 18:03:38 UTC 2018 Modified Files: src/lib/libc/citrus/modules: citrus_mapper_std.c Log Message: Correct Undefined Behavior in libc/citrus Unportable left shift reported with MKSANITIZER=yes USE_SANITIZER=undefined: # nm /usr/lib/libc.so|grep sanit /public/src.git/lib/libc/citrus/modules/citrus_mapper_std.c:173:8: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/lib/libc/citrus/modules/citrus_mapper_std.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_mapper_std.c diff -u src/lib/libc/citrus/modules/citrus_mapper_std.c:1.10 src/lib/libc/citrus/modules/citrus_mapper_std.c:1.11 --- src/lib/libc/citrus/modules/citrus_mapper_std.c:1.10 Sat Nov 19 18:48:39 2011 +++ src/lib/libc/citrus/modules/citrus_mapper_std.c Mon Jun 11 18:03:38 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $ */ +/* $NetBSD: citrus_mapper_std.c,v 1.11 2018/06/11 18:03:38 kamil Exp $ */ /*- * Copyright (c)2003, 2006 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $"); +__RCSID("$NetBSD: citrus_mapper_std.c,v 1.11 2018/06/11 18:03:38 kamil Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -170,7 +170,7 @@ rowcol_parse_variable_compat(struct _cit rc->rc_dst_invalid = be32toh(rcx->rcx_dst_invalid); rc->rc_dst_unit_bits = be32toh(rcx->rcx_dst_unit_bits); m = be32toh(rcx->rcx_src_col_bits); - n = 1 << (m - 1); + n = 1U << (m - 1); n |= n - 1; rc->rc_src_rowcol_bits = m; rc->rc_src_rowcol_mask = n;
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: dholland Date: Tue May 31 03:34:14 UTC 2016 Modified Files: src/lib/libc/citrus/modules: citrus_johab.c Log Message: PR 51000 David Binderman: comment out unused assignment To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/lib/libc/citrus/modules/citrus_johab.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_johab.c diff -u src/lib/libc/citrus/modules/citrus_johab.c:1.5 src/lib/libc/citrus/modules/citrus_johab.c:1.6 --- src/lib/libc/citrus/modules/citrus_johab.c:1.5 Tue May 28 16:57:56 2013 +++ src/lib/libc/citrus/modules/citrus_johab.c Tue May 31 03:34:14 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_johab.c,v 1.5 2013/05/28 16:57:56 joerg Exp $ */ +/* $NetBSD: citrus_johab.c,v 1.6 2016/05/31 03:34:14 dholland Exp $ */ /*- * Copyright (c)2006 Citrus Project, @@ -27,7 +27,7 @@ */ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_johab.c,v 1.5 2013/05/28 16:57:56 joerg Exp $"); +__RCSID("$NetBSD: citrus_johab.c,v 1.6 2016/05/31 03:34:14 dholland Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -349,7 +349,7 @@ _citrus_JOHAB_stdenc_cstowc(_JOHABEncodi l = ((idx >> 8) & 0xFF) - n; t = (idx & 0xFF) - 0x21; linear = (l * 94) + t; - l = (linear / 188) + m; + /*l = (linear / 188) + m;*/ t = linear % 188; t += (t <= 0x4D) ? 0x31 : 0x43; break;
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: christos Date: Sat Jan 18 15:21:41 UTC 2014 Modified Files: src/lib/libc/citrus/modules: citrus_euc.c Log Message: revert previous, it causes other problem and I cannot easily debug it. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/lib/libc/citrus/modules/citrus_euc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_euc.c diff -u src/lib/libc/citrus/modules/citrus_euc.c:1.16 src/lib/libc/citrus/modules/citrus_euc.c:1.17 --- src/lib/libc/citrus/modules/citrus_euc.c:1.16 Thu Jan 16 15:28:51 2014 +++ src/lib/libc/citrus/modules/citrus_euc.c Sat Jan 18 10:21:41 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_euc.c,v 1.16 2014/01/16 20:28:51 christos Exp $ */ +/* $NetBSD: citrus_euc.c,v 1.17 2014/01/18 15:21:41 christos Exp $ */ /*- * Copyright (c)2002 Citrus Project, @@ -60,7 +60,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_euc.c,v 1.16 2014/01/16 20:28:51 christos Exp $"); +__RCSID("$NetBSD: citrus_euc.c,v 1.17 2014/01/18 15:21:41 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -273,8 +273,7 @@ _citrus_EUC_mbrtowc_priv(_EUCEncodingInf wchar = 0; while (len-- > 0) wchar = (wchar << 8) | (*s1++ & 0xff); - if (wchar != (wchar & ~ei->mask) | ei->bits[cs]) - goto encoding_error; + wchar = (wchar & ~ei->mask) | ei->bits[cs]; psenc->chlen = 0; if (pwc)
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: christos Date: Thu Jan 16 20:28:51 UTC 2014 Modified Files: src/lib/libc/citrus/modules: citrus_euc.c Log Message: PR/47602: Christos Zoulas: getwc() modifies input instead of returning EILSEQ. Waited for almost a year for feedback and there was none. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/lib/libc/citrus/modules/citrus_euc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_euc.c diff -u src/lib/libc/citrus/modules/citrus_euc.c:1.15 src/lib/libc/citrus/modules/citrus_euc.c:1.16 --- src/lib/libc/citrus/modules/citrus_euc.c:1.15 Tue May 28 12:57:56 2013 +++ src/lib/libc/citrus/modules/citrus_euc.c Thu Jan 16 15:28:51 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_euc.c,v 1.15 2013/05/28 16:57:56 joerg Exp $ */ +/* $NetBSD: citrus_euc.c,v 1.16 2014/01/16 20:28:51 christos Exp $ */ /*- * Copyright (c)2002 Citrus Project, @@ -60,7 +60,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_euc.c,v 1.15 2013/05/28 16:57:56 joerg Exp $"); +__RCSID("$NetBSD: citrus_euc.c,v 1.16 2014/01/16 20:28:51 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -273,7 +273,8 @@ _citrus_EUC_mbrtowc_priv(_EUCEncodingInf wchar = 0; while (len-- > 0) wchar = (wchar << 8) | (*s1++ & 0xff); - wchar = (wchar & ~ei->mask) | ei->bits[cs]; + if (wchar != (wchar & ~ei->mask) | ei->bits[cs]) + goto encoding_error; psenc->chlen = 0; if (pwc)
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: wiz Date: Sun Feb 12 13:51:29 UTC 2012 Modified Files: src/lib/libc/citrus/modules: citrus_iconv_std.c citrus_ues.c citrus_utf1632.c Log Message: Remove unused variables. From cppcheck via Henning Petersen in PR 45997. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/lib/libc/citrus/modules/citrus_iconv_std.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/citrus/modules/citrus_ues.c cvs rdiff -u -r1.11 -r1.12 src/lib/libc/citrus/modules/citrus_utf1632.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_iconv_std.c diff -u src/lib/libc/citrus/modules/citrus_iconv_std.c:1.15 src/lib/libc/citrus/modules/citrus_iconv_std.c:1.16 --- src/lib/libc/citrus/modules/citrus_iconv_std.c:1.15 Mon Nov 13 19:08:19 2006 +++ src/lib/libc/citrus/modules/citrus_iconv_std.c Sun Feb 12 13:51:29 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_iconv_std.c,v 1.15 2006/11/13 19:08:19 tnozaki Exp $ */ +/* $NetBSD: citrus_iconv_std.c,v 1.16 2012/02/12 13:51:29 wiz Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_iconv_std.c,v 1.15 2006/11/13 19:08:19 tnozaki Exp $"); +__RCSID("$NetBSD: citrus_iconv_std.c,v 1.16 2012/02/12 13:51:29 wiz Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -418,7 +418,6 @@ _citrus_iconv_std_iconv_init_context(str { const struct _citrus_iconv_std_shared *is = cv->cv_shared->ci_closure; struct _citrus_iconv_std_context *sc; - int ret; size_t szpssrc, szpsdst, sz; char *ptr; Index: src/lib/libc/citrus/modules/citrus_ues.c diff -u src/lib/libc/citrus/modules/citrus_ues.c:1.2 src/lib/libc/citrus/modules/citrus_ues.c:1.3 --- src/lib/libc/citrus/modules/citrus_ues.c:1.2 Tue Dec 7 22:01:22 2010 +++ src/lib/libc/citrus/modules/citrus_ues.c Sun Feb 12 13:51:29 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_ues.c,v 1.2 2010/12/07 22:01:22 joerg Exp $ */ +/* $NetBSD: citrus_ues.c,v 1.3 2012/02/12 13:51:29 wiz Exp $ */ /*- * Copyright (c)2006 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_ues.c,v 1.2 2010/12/07 22:01:22 joerg Exp $"); +__RCSID("$NetBSD: citrus_ues.c,v 1.3 2012/02/12 13:51:29 wiz Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -212,7 +212,7 @@ _citrus_UES_mbrtowc_priv(_UESEncodingInf _UESState * __restrict psenc, size_t * __restrict nresult) { const char *s0; - int ch, head, tail, i, num; + int ch, head, tail, num; wchar_t hi, wc; _DIAGASSERT(ei != NULL); Index: src/lib/libc/citrus/modules/citrus_utf1632.c diff -u src/lib/libc/citrus/modules/citrus_utf1632.c:1.11 src/lib/libc/citrus/modules/citrus_utf1632.c:1.12 --- src/lib/libc/citrus/modules/citrus_utf1632.c:1.11 Sat Mar 20 18:15:32 2010 +++ src/lib/libc/citrus/modules/citrus_utf1632.c Sun Feb 12 13:51:29 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_utf1632.c,v 1.11 2010/03/20 18:15:32 tnozaki Exp $ */ +/* $NetBSD: citrus_utf1632.c,v 1.12 2012/02/12 13:51:29 wiz Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_utf1632.c,v 1.11 2010/03/20 18:15:32 tnozaki Exp $"); +__RCSID("$NetBSD: citrus_utf1632.c,v 1.12 2012/02/12 13:51:29 wiz Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -250,7 +250,6 @@ _citrus_UTF1632_wcrtomb_priv(_UTF1632Enc wchar_t wc, _UTF1632State *psenc, size_t *nresult) { - int ret; wchar_t wc2; static const char _bom[4] = { #if BYTE_ORDER == BIG_ENDIAN
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: tnozaki Date: Sat Nov 19 18:48:39 UTC 2011 Modified Files: src/lib/libc/citrus/modules: citrus_mapper_std.c Log Message: fix memory leak, pointed by nonaka-san(again^3). To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/lib/libc/citrus/modules/citrus_mapper_std.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_mapper_std.c diff -u src/lib/libc/citrus/modules/citrus_mapper_std.c:1.9 src/lib/libc/citrus/modules/citrus_mapper_std.c:1.10 --- src/lib/libc/citrus/modules/citrus_mapper_std.c:1.9 Sun Oct 30 21:48:27 2011 +++ src/lib/libc/citrus/modules/citrus_mapper_std.c Sat Nov 19 18:48:39 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_mapper_std.c,v 1.9 2011/10/30 21:48:27 wiz Exp $ */ +/* $NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $ */ /*- * Copyright (c)2003, 2006 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_mapper_std.c,v 1.9 2011/10/30 21:48:27 wiz Exp $"); +__RCSID("$NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -185,8 +185,11 @@ rowcol_parse_variable_compat(struct _cit n = be32toh(rcx->rcx_src_row_end); if (m + n > 0) { ret = set_linear_zone(lz, m, n); - if (ret != 0) + if (ret != 0) { + free(rc->rc_src_rowcol); + rc->rc_src_rowcol = NULL; return ret; + } ++rc->rc_src_rowcol_len, ++lz; } m = be32toh(rcx->rcx_src_col_begin);
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: tnozaki Date: Sat Nov 19 18:20:13 UTC 2011 Modified Files: src/lib/libc/citrus/modules: citrus_dechanyu.c citrus_viqr.c Log Message: remove unused variable, pointed by nonaka-san, thanks. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/modules/citrus_dechanyu.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/citrus/modules/citrus_viqr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_dechanyu.c diff -u src/lib/libc/citrus/modules/citrus_dechanyu.c:1.3 src/lib/libc/citrus/modules/citrus_dechanyu.c:1.4 --- src/lib/libc/citrus/modules/citrus_dechanyu.c:1.3 Sat Jun 14 16:01:07 2008 +++ src/lib/libc/citrus/modules/citrus_dechanyu.c Sat Nov 19 18:20:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_dechanyu.c,v 1.3 2008/06/14 16:01:07 tnozaki Exp $ */ +/* $NetBSD: citrus_dechanyu.c,v 1.4 2011/11/19 18:20:13 tnozaki Exp $ */ /*- * Copyright (c)2007 Citrus Project, @@ -27,7 +27,7 @@ */ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_dechanyu.c,v 1.3 2008/06/14 16:01:07 tnozaki Exp $"); +__RCSID("$NetBSD: citrus_dechanyu.c,v 1.4 2011/11/19 18:20:13 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -187,7 +187,7 @@ _citrus_DECHanyu_mbrtowc_priv(_DECHanyuE _DECHanyuState * __restrict psenc, size_t * __restrict nresult) { const char *s0; - int ch, i; + int ch; wchar_t wc; /* ei may be unused */ Index: src/lib/libc/citrus/modules/citrus_viqr.c diff -u src/lib/libc/citrus/modules/citrus_viqr.c:1.4 src/lib/libc/citrus/modules/citrus_viqr.c:1.5 --- src/lib/libc/citrus/modules/citrus_viqr.c:1.4 Sat Jun 14 16:01:08 2008 +++ src/lib/libc/citrus/modules/citrus_viqr.c Sat Nov 19 18:20:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_viqr.c,v 1.4 2008/06/14 16:01:08 tnozaki Exp $ */ +/* $NetBSD: citrus_viqr.c,v 1.5 2011/11/19 18:20:13 tnozaki Exp $ */ /*- * Copyright (c)2006 Citrus Project, @@ -29,7 +29,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_viqr.c,v 1.4 2008/06/14 16:01:08 tnozaki Exp $"); +__RCSID("$NetBSD: citrus_viqr.c,v 1.5 2011/11/19 18:20:13 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -360,7 +360,7 @@ _citrus_VIQR_wcrtomb_priv(_VIQREncodingI _VIQRState * __restrict psenc, size_t * __restrict nresult) { mnemonic_t *m; - int ch, escape; + int ch; const char *p; _DIAGASSERT(ei != NULL);
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: wiz Date: Sun Oct 30 21:48:27 UTC 2011 Modified Files: src/lib/libc/citrus/modules: citrus_mapper_std.c Log Message: Use boolean AND instead of bitwise one in _DIAGASSERT. >From Henning Petersen in PR 45518. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libc/citrus/modules/citrus_mapper_std.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_mapper_std.c diff -u src/lib/libc/citrus/modules/citrus_mapper_std.c:1.8 src/lib/libc/citrus/modules/citrus_mapper_std.c:1.9 --- src/lib/libc/citrus/modules/citrus_mapper_std.c:1.8 Mon Sep 11 13:06:33 2006 +++ src/lib/libc/citrus/modules/citrus_mapper_std.c Sun Oct 30 21:48:27 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_mapper_std.c,v 1.8 2006/09/11 13:06:33 tnozaki Exp $ */ +/* $NetBSD: citrus_mapper_std.c,v 1.9 2011/10/30 21:48:27 wiz Exp $ */ /*- * Copyright (c)2003, 2006 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_mapper_std.c,v 1.8 2006/09/11 13:06:33 tnozaki Exp $"); +__RCSID("$NetBSD: citrus_mapper_std.c,v 1.9 2011/10/30 21:48:27 wiz Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -426,7 +426,7 @@ _citrus_mapper_std_mapper_uninit(struct { struct _citrus_mapper_std *ms; - _DIAGASSERT(cm!=NULL & cm->cm_closure!=NULL); + _DIAGASSERT(cm!=NULL && cm->cm_closure!=NULL); ms = cm->cm_closure; if (ms->ms_uninit)
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: tnozaki Date: Mon Oct 10 22:45:45 UTC 2011 Modified Files: src/lib/libc/citrus/modules: citrus_iso2022.c Log Message: revert r1.21, still problem exists for posix2008 mbsnrtowcs(not yet commited), but i have no time to investigate t_mbrtowc failure. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/lib/libc/citrus/modules/citrus_iso2022.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_iso2022.c diff -u src/lib/libc/citrus/modules/citrus_iso2022.c:1.21 src/lib/libc/citrus/modules/citrus_iso2022.c:1.22 --- src/lib/libc/citrus/modules/citrus_iso2022.c:1.21 Fri Oct 7 18:59:13 2011 +++ src/lib/libc/citrus/modules/citrus_iso2022.c Mon Oct 10 22:45:45 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_iso2022.c,v 1.21 2011/10/07 18:59:13 tnozaki Exp $ */ +/* $NetBSD: citrus_iso2022.c,v 1.22 2011/10/10 22:45:45 tnozaki Exp $ */ /*- * Copyright (c)1999, 2002 Citrus Project, @@ -30,7 +30,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_iso2022.c,v 1.21 2011/10/07 18:59:13 tnozaki Exp $"); +__RCSID("$NetBSD: citrus_iso2022.c,v 1.22 2011/10/10 22:45:45 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -695,7 +695,7 @@ _ISO2022_sgetwchar(_ISO2022EncodingInfo if (n < sp->len) { if (nmatch == n) { if (result) - *result = string + n; + *result = string; return (_ISO2022INVALID); } } else { @@ -755,7 +755,7 @@ asis: /* we still need to wait for more characters to come */ if (result) - *result = string + n; + *result = string; return (_ISO2022INVALID); case CS94: @@ -765,7 +765,7 @@ asis: /* we still need to wait for more characters to come */ if (result) - *result = string + n; + *result = string; return (_ISO2022INVALID); }
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: tnozaki Date: Fri Oct 7 18:59:13 UTC 2011 Modified Files: src/lib/libc/citrus/modules: citrus_iso2022.c Log Message: update string pointer when input is partial escape sequence or multibyte. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/lib/libc/citrus/modules/citrus_iso2022.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_iso2022.c diff -u src/lib/libc/citrus/modules/citrus_iso2022.c:1.20 src/lib/libc/citrus/modules/citrus_iso2022.c:1.21 --- src/lib/libc/citrus/modules/citrus_iso2022.c:1.20 Tue Dec 7 22:01:45 2010 +++ src/lib/libc/citrus/modules/citrus_iso2022.c Fri Oct 7 18:59:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_iso2022.c,v 1.20 2010/12/07 22:01:45 joerg Exp $ */ +/* $NetBSD: citrus_iso2022.c,v 1.21 2011/10/07 18:59:13 tnozaki Exp $ */ /*- * Copyright (c)1999, 2002 Citrus Project, @@ -30,7 +30,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_iso2022.c,v 1.20 2010/12/07 22:01:45 joerg Exp $"); +__RCSID("$NetBSD: citrus_iso2022.c,v 1.21 2011/10/07 18:59:13 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -695,7 +695,7 @@ _ISO2022_sgetwchar(_ISO2022EncodingInfo if (n < sp->len) { if (nmatch == n) { if (result) - *result = string; + *result = string + n; return (_ISO2022INVALID); } } else { @@ -755,7 +755,7 @@ asis: /* we still need to wait for more characters to come */ if (result) - *result = string; + *result = string + n; return (_ISO2022INVALID); case CS94: @@ -765,7 +765,7 @@ asis: /* we still need to wait for more characters to come */ if (result) - *result = string; + *result = string + n; return (_ISO2022INVALID); }
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: joerg Date: Mon May 23 14:53:46 UTC 2011 Modified Files: src/lib/libc/citrus/modules: citrus_big5.c Log Message: Make intermediate size variable size_t like the rest to avoid unnecessary casting. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/lib/libc/citrus/modules/citrus_big5.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_big5.c diff -u src/lib/libc/citrus/modules/citrus_big5.c:1.12 src/lib/libc/citrus/modules/citrus_big5.c:1.13 --- src/lib/libc/citrus/modules/citrus_big5.c:1.12 Sat Jun 14 16:01:07 2008 +++ src/lib/libc/citrus/modules/citrus_big5.c Mon May 23 14:53:46 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_big5.c,v 1.12 2008/06/14 16:01:07 tnozaki Exp $ */ +/* $NetBSD: citrus_big5.c,v 1.13 2011/05/23 14:53:46 joerg Exp $ */ /*- * Copyright (c)2002, 2006 Citrus Project, @@ -60,7 +60,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_big5.c,v 1.12 2008/06/14 16:01:07 tnozaki Exp $"); +__RCSID("$NetBSD: citrus_big5.c,v 1.13 2011/05/23 14:53:46 joerg Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -393,7 +393,7 @@ size_t n, wchar_t wc, _BIG5State * __restrict psenc, size_t * __restrict nresult) { - int l, ret; + size_t l, ret; _DIAGASSERT(ei != NULL); _DIAGASSERT(nresult != 0);
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: joerg Date: Mon May 23 14:45:44 UTC 2011 Modified Files: src/lib/libc/citrus/modules: citrus_iconv_none.c Log Message: Actually return something deterministic To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/libc/citrus/modules/citrus_iconv_none.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_iconv_none.c diff -u src/lib/libc/citrus/modules/citrus_iconv_none.c:1.2 src/lib/libc/citrus/modules/citrus_iconv_none.c:1.3 --- src/lib/libc/citrus/modules/citrus_iconv_none.c:1.2 Tue Jul 1 09:42:16 2003 +++ src/lib/libc/citrus/modules/citrus_iconv_none.c Mon May 23 14:45:44 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_iconv_none.c,v 1.2 2003/07/01 09:42:16 tshiozak Exp $ */ +/* $NetBSD: citrus_iconv_none.c,v 1.3 2011/05/23 14:45:44 joerg Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_iconv_none.c,v 1.2 2003/07/01 09:42:16 tshiozak Exp $"); +__RCSID("$NetBSD: citrus_iconv_none.c,v 1.3 2011/05/23 14:45:44 joerg Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -87,6 +87,7 @@ _citrus_iconv_none_iconv_init_context(struct _citrus_iconv *cv) { cv->cv_closure = NULL; + return 0; } static void
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: joerg Date: Tue Dec 7 22:01:45 UTC 2010 Modified Files: src/lib/libc/citrus/modules: citrus_iso2022.c Log Message: Remove tautology. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/lib/libc/citrus/modules/citrus_iso2022.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_iso2022.c diff -u src/lib/libc/citrus/modules/citrus_iso2022.c:1.19 src/lib/libc/citrus/modules/citrus_iso2022.c:1.20 --- src/lib/libc/citrus/modules/citrus_iso2022.c:1.19 Sat Jun 14 16:01:07 2008 +++ src/lib/libc/citrus/modules/citrus_iso2022.c Tue Dec 7 22:01:45 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_iso2022.c,v 1.19 2008/06/14 16:01:07 tnozaki Exp $ */ +/* $NetBSD: citrus_iso2022.c,v 1.20 2010/12/07 22:01:45 joerg Exp $ */ /*- * Copyright (c)1999, 2002 Citrus Project, @@ -30,7 +30,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_iso2022.c,v 1.19 2008/06/14 16:01:07 tnozaki Exp $"); +__RCSID("$NetBSD: citrus_iso2022.c,v 1.20 2010/12/07 22:01:45 joerg Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -880,7 +880,7 @@ /* buffer is not empty */ p = psenc->ch; - while (psenc->chlen < sizeof(psenc->ch) && n >= 0) { + while (psenc->chlen < sizeof(psenc->ch)) { if (n > 0) { psenc->ch[psenc->chlen++] = *s0++; n--;
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: joerg Date: Tue Dec 7 22:01:23 UTC 2010 Modified Files: src/lib/libc/citrus/modules: citrus_ues.c Log Message: Mark function as static and give it an explicit return type. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/libc/citrus/modules/citrus_ues.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_ues.c diff -u src/lib/libc/citrus/modules/citrus_ues.c:1.1 src/lib/libc/citrus/modules/citrus_ues.c:1.2 --- src/lib/libc/citrus/modules/citrus_ues.c:1.1 Mon Nov 13 15:16:31 2006 +++ src/lib/libc/citrus/modules/citrus_ues.c Tue Dec 7 22:01:22 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_ues.c,v 1.1 2006/11/13 15:16:31 tnozaki Exp $ */ +/* $NetBSD: citrus_ues.c,v 1.2 2010/12/07 22:01:22 joerg Exp $ */ /*- * Copyright (c)2006 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_ues.c,v 1.1 2006/11/13 15:16:31 tnozaki Exp $"); +__RCSID("$NetBSD: citrus_ues.c,v 1.2 2010/12/07 22:01:22 joerg Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -367,6 +367,7 @@ } /*ARGSUSED*/ +static int _citrus_UES_stdenc_wctocs(_UESEncodingInfo * __restrict ei, _csid_t * __restrict csid, _index_t * __restrict idx, wchar_t wc) {
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: tnozaki Date: Sat Mar 20 18:15:32 UTC 2010 Modified Files: src/lib/libc/citrus/modules: citrus_utf1632.c Log Message: fix byte order mark related bug introduced by previous commit, reported by Sverre Froyen via current-user, thanks! To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/lib/libc/citrus/modules/citrus_utf1632.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_utf1632.c diff -u src/lib/libc/citrus/modules/citrus_utf1632.c:1.10 src/lib/libc/citrus/modules/citrus_utf1632.c:1.11 --- src/lib/libc/citrus/modules/citrus_utf1632.c:1.10 Mon Mar 15 15:00:58 2010 +++ src/lib/libc/citrus/modules/citrus_utf1632.c Sat Mar 20 18:15:32 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_utf1632.c,v 1.10 2010/03/15 15:00:58 tnozaki Exp $ */ +/* $NetBSD: citrus_utf1632.c,v 1.11 2010/03/20 18:15:32 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_utf1632.c,v 1.10 2010/03/15 15:00:58 tnozaki Exp $"); +__RCSID("$NetBSD: citrus_utf1632.c,v 1.11 2010/03/20 18:15:32 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -155,9 +155,8 @@ goto refetch; } } - } else { - psenc->current_endian = ei->preffered_endian; } + psenc->current_endian = ei->preffered_endian; } endian = psenc->current_endian;
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: tnozaki Date: Mon Mar 15 15:00:58 UTC 2010 Modified Files: src/lib/libc/citrus/modules: citrus_utf1632.c Log Message: 1. fix wrong byte order mark of utf-16, reported by NARUSE Yui -san. patch provided by tshiozak@ -san. 2. don't eat 0xfeff/0xfffe if they don't appear at the first of bytestream. noticed y tshiozak@ -san, patch provied by me. thanks a lot. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/lib/libc/citrus/modules/citrus_utf1632.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_utf1632.c diff -u src/lib/libc/citrus/modules/citrus_utf1632.c:1.9 src/lib/libc/citrus/modules/citrus_utf1632.c:1.10 --- src/lib/libc/citrus/modules/citrus_utf1632.c:1.9 Sat Jun 14 16:01:08 2008 +++ src/lib/libc/citrus/modules/citrus_utf1632.c Mon Mar 15 15:00:58 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_utf1632.c,v 1.9 2008/06/14 16:01:08 tnozaki Exp $ */ +/* $NetBSD: citrus_utf1632.c,v 1.10 2010/03/15 15:00:58 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -28,7 +28,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_utf1632.c,v 1.9 2008/06/14 16:01:08 tnozaki Exp $"); +__RCSID("$NetBSD: citrus_utf1632.c,v 1.10 2010/03/15 15:00:58 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include @@ -127,37 +127,39 @@ result++; } - /* judge endian marker */ - if ((ei->mode & _MODE_UTF32) == 0) { - /* UTF16 */ - if (psenc->ch[0]==0xFE && psenc->ch[1]==0xFF) { - psenc->current_endian = _ENDIAN_BIG; - chlenbak = 0; - goto refetch; - } else if (psenc->ch[0]==0xFF && psenc->ch[1]==0xFE) { - psenc->current_endian = _ENDIAN_LITTLE; - chlenbak = 0; - goto refetch; - } - } else { - /* UTF32 */ - if (psenc->ch[0]==0x00 && psenc->ch[1]==0x00 && - psenc->ch[2]==0xFE && psenc->ch[3]==0xFF) { - psenc->current_endian = _ENDIAN_BIG; - chlenbak = 0; - goto refetch; - } else if (psenc->ch[0]==0xFF && psenc->ch[1]==0xFE && - psenc->ch[2]==0x00 && psenc->ch[3]==0x00) { - psenc->current_endian = _ENDIAN_LITTLE; - chlenbak = 0; - goto refetch; + if (psenc->current_endian == _ENDIAN_UNKNOWN) { + if ((ei->mode & _MODE_FORCE_ENDIAN) == 0) { + /* judge endian marker */ + if ((ei->mode & _MODE_UTF32) == 0) { +/* UTF16 */ +if (psenc->ch[0]==0xFE && psenc->ch[1]==0xFF) { + psenc->current_endian = _ENDIAN_BIG; + chlenbak = 0; + goto refetch; +} else if (psenc->ch[0]==0xFF && psenc->ch[1]==0xFE) { + psenc->current_endian = _ENDIAN_LITTLE; + chlenbak = 0; + goto refetch; +} + } else { +/* UTF32 */ +if (psenc->ch[0]==0x00 && psenc->ch[1]==0x00 && +psenc->ch[2]==0xFE && psenc->ch[3]==0xFF) { + psenc->current_endian = _ENDIAN_BIG; + chlenbak = 0; + goto refetch; +} else if (psenc->ch[0]==0xFF && psenc->ch[1]==0xFE && + psenc->ch[2]==0x00 && psenc->ch[3]==0x00) { + psenc->current_endian = _ENDIAN_LITTLE; + chlenbak = 0; + goto refetch; +} + } + } else { + psenc->current_endian = ei->preffered_endian; } } - if ((ei->mode & _MODE_FORCE_ENDIAN) != 0 || - psenc->current_endian == _ENDIAN_UNKNOWN) - endian = ei->preffered_endian; - else - endian = psenc->current_endian; + endian = psenc->current_endian; /* get wc */ if ((ei->mode & _MODE_UTF32) == 0) { @@ -186,13 +188,13 @@ wc <<= 10; switch (endian) { case _ENDIAN_LITTLE: -if (psenc->ch[2]<0xDC || psenc->ch[2]>0xDF) +if (psenc->ch[3]<0xDC || psenc->ch[3]>0xDF) goto ilseq; wc |= psenc->ch[2]; wc |= (wchar_t)(psenc->ch[3] & 3) << 8; break; case _ENDIAN_BIG: -if (psenc->ch[3]<0xDC || psenc->ch[3]>0xDF) +if (psenc->ch[2]<0xDC || psenc->ch[2]>0xDF) goto ilseq; wc |= psenc->ch[3]; wc |= (wchar_t)(psenc->ch[2] & 3) << 8;