CVS commit: src/lib/libc/citrus

2021-10-29 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri Oct 29 10:54:56 UTC 2021

Modified Files:
src/lib/libc/citrus: citrus_db_factory.c

Log Message:
citrus: Use calloc instead of malloc'ing and clearing the array manually


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/citrus/citrus_db_factory.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/citrus

2021-10-29 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri Oct 29 10:54:56 UTC 2021

Modified Files:
src/lib/libc/citrus: citrus_db_factory.c

Log Message:
citrus: Use calloc instead of malloc'ing and clearing the array manually


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/citrus/citrus_db_factory.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/citrus_db_factory.c
diff -u src/lib/libc/citrus/citrus_db_factory.c:1.10 src/lib/libc/citrus/citrus_db_factory.c:1.11
--- src/lib/libc/citrus/citrus_db_factory.c:1.10	Sat Sep 14 13:05:51 2013
+++ src/lib/libc/citrus/citrus_db_factory.c	Fri Oct 29 10:54:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_db_factory.c,v 1.10 2013/09/14 13:05:51 joerg Exp $	*/
+/*	$NetBSD: citrus_db_factory.c,v 1.11 2021/10/29 10:54:56 nia Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -32,7 +32,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_db_factory.c,v 1.10 2013/09/14 13:05:51 joerg Exp $");
+__RCSID("$NetBSD: citrus_db_factory.c,v 1.11 2021/10/29 10:54:56 nia Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -274,11 +274,9 @@ _citrus_db_factory_serialize(struct _cit
 		return 0;
 	}
 	/* allocate hash table */
-	depp = malloc(sizeof(*depp) * df->df_num_entries);
+	depp = calloc(df->df_num_entries, sizeof(*depp));
 	if (depp == NULL)
 		return -1;
-	for (i = 0; i < df->df_num_entries; i++)
-		depp[i] = NULL;
 
 	/* step1: store the entries which are not conflicting */
 	SIMPLEQ_FOREACH(de, >df_entries, de_entry) {



CVS commit: src/lib/libc/citrus

2019-10-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  9 23:23:42 UTC 2019

Modified Files:
src/lib/libc/citrus: citrus_csmapper.c

Log Message:
bump size


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/citrus/citrus_csmapper.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/citrus_csmapper.c
diff -u src/lib/libc/citrus/citrus_csmapper.c:1.11 src/lib/libc/citrus/citrus_csmapper.c:1.12
--- src/lib/libc/citrus/citrus_csmapper.c:1.11	Sun Nov 20 02:43:52 2011
+++ src/lib/libc/citrus/citrus_csmapper.c	Wed Oct  9 19:23:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_csmapper.c,v 1.11 2011/11/20 07:43:52 tnozaki Exp $	*/
+/*	$NetBSD: citrus_csmapper.c,v 1.12 2019/10/09 23:23:41 christos Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_csmapper.c,v 1.11 2011/11/20 07:43:52 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_csmapper.c,v 1.12 2019/10/09 23:23:41 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -305,7 +305,7 @@ open_serial_mapper(struct _citrus_mapper
 		   struct _citrus_mapper * __restrict * __restrict rcm,
 		   const char *src, const char *pivot, const char *dst)
 {
-	char buf[PATH_MAX];
+	char buf[4 * PATH_MAX];
 
 	snprintf(buf, sizeof(buf), "%s/%s,%s/%s", src, pivot, pivot, dst);
 



CVS commit: src/lib/libc/citrus

2019-10-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  9 23:24:00 UTC 2019

Modified Files:
src/lib/libc/citrus: citrus_iconv.c

Log Message:
bump size


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/citrus/citrus_iconv.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/citrus_iconv.c
diff -u src/lib/libc/citrus/citrus_iconv.c:1.10 src/lib/libc/citrus/citrus_iconv.c:1.11
--- src/lib/libc/citrus/citrus_iconv.c:1.10	Sat Nov 19 13:34:21 2011
+++ src/lib/libc/citrus/citrus_iconv.c	Wed Oct  9 19:24:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_iconv.c,v 1.10 2011/11/19 18:34:21 tnozaki Exp $	*/
+/*	$NetBSD: citrus_iconv.c,v 1.11 2019/10/09 23:24:00 christos Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_iconv.c,v 1.10 2011/11/19 18:34:21 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_iconv.c,v 1.11 2019/10/09 23:24:00 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -262,7 +262,7 @@ get_shared(struct _citrus_iconv_shared *
 	int ret = 0;
 	int hashval;
 	struct _citrus_iconv_shared * ci;
-	char convname[PATH_MAX];
+	char convname[2 * PATH_MAX];
 
 	snprintf(convname, sizeof(convname), "%s/%s", src, dst);
 



CVS commit: src/lib/libc/citrus

2019-10-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  9 23:24:00 UTC 2019

Modified Files:
src/lib/libc/citrus: citrus_iconv.c

Log Message:
bump size


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/citrus/citrus_iconv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/citrus

2019-10-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  9 23:23:42 UTC 2019

Modified Files:
src/lib/libc/citrus: citrus_csmapper.c

Log Message:
bump size


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/citrus/citrus_csmapper.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/citrus

2019-07-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 28 14:26:08 UTC 2019

Modified Files:
src/lib/libc/citrus: citrus_ctype_template.h

Log Message:
PR/54414: Valery Ushakov: c99 requires that wcsrtombs(3) updates the source
argument on conversion error


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/lib/libc/citrus/citrus_ctype_template.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/citrus

2019-07-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 28 14:26:08 UTC 2019

Modified Files:
src/lib/libc/citrus: citrus_ctype_template.h

Log Message:
PR/54414: Valery Ushakov: c99 requires that wcsrtombs(3) updates the source
argument on conversion error


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/lib/libc/citrus/citrus_ctype_template.h

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/citrus_ctype_template.h
diff -u src/lib/libc/citrus/citrus_ctype_template.h:1.36 src/lib/libc/citrus/citrus_ctype_template.h:1.37
--- src/lib/libc/citrus/citrus_ctype_template.h:1.36	Tue May 28 12:57:56 2013
+++ src/lib/libc/citrus/citrus_ctype_template.h	Sun Jul 28 10:26:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_ctype_template.h,v 1.36 2013/05/28 16:57:56 joerg Exp $	*/
+/*	$NetBSD: citrus_ctype_template.h,v 1.37 2019/07/28 14:26:08 christos Exp $	*/
 
 /*-
  * Copyright (c)2002 Citrus Project,
@@ -372,6 +372,7 @@ _FUNCNAME(wcsrtombs_priv)(_ENCODING_INFO
 		err = _FUNCNAME(wcrtomb_priv)(ei, buf, sizeof(buf),
 	  *pwcs0, psenc, );
 		if (siz == (size_t)-1) {
+			*pwcs = pwcs0;
 			*nresult = siz;
 			return (err);
 		}



CVS commit: src/lib/libc/citrus

2019-07-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 28 13:52:24 UTC 2019

Modified Files:
src/lib/libc/citrus: citrus_none.c

Log Message:
PR/54414: Valery Ushakov: c99 requires that wcsrtombs(3) updates the source
argument on conversion error


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/citrus/citrus_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/citrus_none.c
diff -u src/lib/libc/citrus/citrus_none.c:1.22 src/lib/libc/citrus/citrus_none.c:1.23
--- src/lib/libc/citrus/citrus_none.c:1.22	Thu Jul 13 12:00:30 2017
+++ src/lib/libc/citrus/citrus_none.c	Sun Jul 28 09:52:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_none.c,v 1.22 2017/07/13 16:00:30 christos Exp $	*/
+/*	$NetBSD: citrus_none.c,v 1.23 2019/07/28 13:52:23 christos Exp $	*/
 
 /*-
  * Copyright (c)2002 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_none.c,v 1.22 2017/07/13 16:00:30 christos Exp $");
+__RCSID("$NetBSD: citrus_none.c,v 1.23 2019/07/28 13:52:23 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -300,6 +300,7 @@ _citrus_NONE_ctype_wcsrtombs(void * __re
 
 	while (n > 0) {
 		if ((*pwcs0 & ~0xFFU) != 0) {
+			*pwcs = pwcs0;
 			*nresult = (size_t)-1;
 			return (EILSEQ);
 		}



CVS commit: src/lib/libc/citrus

2019-07-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 28 13:52:24 UTC 2019

Modified Files:
src/lib/libc/citrus: citrus_none.c

Log Message:
PR/54414: Valery Ushakov: c99 requires that wcsrtombs(3) updates the source
argument on conversion error


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/citrus/citrus_none.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/lib/libc/citrus/modules

2019-07-08 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Jul  8 06:45:01 UTC 2019

Modified Files:
src/lib/libc/citrus/modules: citrus_johab.c

Log Message:
The correct fix for lib/51000 is not to remove the apparently dead assignment
but to add the missing usage.

>From https://bitbucket.org/tnozaki/netbsd/commits/24b35fdce250
Thanks to Takehiko Nozaki


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 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.6 src/lib/libc/citrus/modules/citrus_johab.c:1.7
--- src/lib/libc/citrus/modules/citrus_johab.c:1.6	Tue May 31 03:34:14 2016
+++ src/lib/libc/citrus/modules/citrus_johab.c	Mon Jul  8 06:45:01 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_johab.c,v 1.6 2016/05/31 03:34:14 dholland Exp $ */
+/* $NetBSD: citrus_johab.c,v 1.7 2019/07/08 06:45:01 mlelstv Exp $ */
 
 /*-
  * Copyright (c)2006 Citrus Project,
@@ -27,7 +27,7 @@
  */
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_johab.c,v 1.6 2016/05/31 03:34:14 dholland Exp $");
+__RCSID("$NetBSD: citrus_johab.c,v 1.7 2019/07/08 06:45:01 mlelstv Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -349,9 +349,10 @@ _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;
+		*wc = (wchar_t)((l << 8) | t);
 		break;
 	default:
 		return EILSEQ;



CVS commit: src/lib/libc/citrus/modules

2019-07-08 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Jul  8 06:45:01 UTC 2019

Modified Files:
src/lib/libc/citrus/modules: citrus_johab.c

Log Message:
The correct fix for lib/51000 is not to remove the apparently dead assignment
but to add the missing usage.

>From https://bitbucket.org/tnozaki/netbsd/commits/24b35fdce250
Thanks to Takehiko Nozaki


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 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.



Re: CVS commit: src/lib/libc/citrus

2012-05-04 Thread Joerg Sonnenberger
On Fri, May 04, 2012 at 04:45:05PM +, Joerg Sonnenberger wrote:
 Module Name:  src
 Committed By: joerg
 Date: Fri May  4 16:45:05 UTC 2012
 
 Modified Files:
   src/lib/libc/citrus: citrus_lookup.c
 
 

Changedto: Do not depend on failing malloc to set errno

Joerg