X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Fliblunicode%2Fucdata%2Fucgendat.c;h=3be66a670eb34df44ed6984e32a4ab437131cac4;hb=a7c595088c1561c4f08932a97f9a716ae9dabd9c;hp=7403a1dd81a7a11a3d92db1779ba9e80545c1b15;hpb=23f3214f5e62b3f1be6ced2ffc1842705fddd21e;p=openldap
diff --git a/libraries/liblunicode/ucdata/ucgendat.c b/libraries/liblunicode/ucdata/ucgendat.c
index 7403a1dd81..3be66a670e 100644
--- a/libraries/liblunicode/ucdata/ucgendat.c
+++ b/libraries/liblunicode/ucdata/ucgendat.c
@@ -1,7 +1,7 @@
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software .
*
- * Copyright 1998-2004 The OpenLDAP Foundation.
+ * Copyright 1998-2012 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -38,6 +38,7 @@
#include "ldap_config.h"
#include
+#include
#include
#include
#include
@@ -140,7 +141,7 @@ static ac_uint4 kdecomps_size;
*/
#define COMPEX_SET(c) (compexs[(c) >> 5] |= (1 << ((c) & 31)))
#define COMPEX_TEST(c) (compexs[(c) >> 5] & (1 << ((c) & 31)))
-static ac_uint4 compexs[2048];
+static ac_uint4 compexs[8192];
/*
* Struct for holding a composition pair, and array of composition pairs
@@ -1204,10 +1205,11 @@ cmpcomps(const void *v_comp1, const void *v_comp2)
static void
read_compexdata(FILE *in)
{
- ac_uint2 i, code;
+ ac_uint2 i;
+ ac_uint4 code;
char line[512], *s;
- (void) memset((char *) compexs, 0, sizeof(ac_uint4) << 11);
+ (void) memset((char *) compexs, 0, sizeof(compexs));
while (fgets(line, sizeof(line), in)) {
if( (s=strchr(line, '\n')) ) *s = '\0';
@@ -1218,10 +1220,11 @@ read_compexdata(FILE *in)
continue;
/*
- * Collect the code. Assume max 4 digits
+ * Collect the code. Assume max 6 digits
*/
- for (s = line, i = code = 0; *s != '#' && i < 4; i++, s++) {
+ for (s = line, i = code = 0; *s != '#' && i < 6; i++, s++) {
+ if (isspace((unsigned char)*s)) break;
code <<= 4;
if (*s >= '0' && *s <= '9')
code += *s - '0';
@@ -1266,8 +1269,9 @@ write_case(FILE *out, _case_t *tab, int num, int first)
for (i=0; i 0)
@@ -1489,8 +1495,8 @@ write_cdata(char *opath)
create_comps();
#if HARDCODE_DATA
- fprintf(out, PREF "ac_uint4 _uccomp_size = %d;\n\n",
- comps_used * 4);
+ fprintf(out, PREF "ac_uint4 _uccomp_size = %ld;\n\n",
+ comps_used * 4L);
fprintf(out, PREF "ac_uint4 _uccomp_data[] = {");
@@ -1500,8 +1506,9 @@ write_cdata(char *opath)
if (comps_used > 0) {
for (i=0; i