summaryrefslogtreecommitdiff
path: root/lib/uninorm/u-normcoll.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/uninorm/u-normcoll.h')
-rw-r--r--lib/uninorm/u-normcoll.h24
1 files changed, 9 insertions, 15 deletions
diff --git a/lib/uninorm/u-normcoll.h b/lib/uninorm/u-normcoll.h
index 948462c0..fd2dd71f 100644
--- a/lib/uninorm/u-normcoll.h
+++ b/lib/uninorm/u-normcoll.h
@@ -1,5 +1,5 @@
/* Locale dependent, normalization insensitive comparison of Unicode strings.
- Copyright (C) 2009-2025 Free Software Foundation, Inc.
+ Copyright (C) 2009-2026 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2009.
This file is free software.
@@ -27,24 +27,18 @@ int
FUNC (const UNIT *s1, size_t n1, const UNIT *s2, size_t n2,
uninorm_t nf, int *resultp)
{
- char buf1[2048];
- char buf2[2048];
- char *transformed1;
- size_t transformed1_length;
- char *transformed2;
- size_t transformed2_length;
- int cmp;
-
/* Normalize and transform S1. */
- transformed1_length = sizeof (buf1);
- transformed1 = U_NORMXFRM (s1, n1, nf, buf1, &transformed1_length);
+ char buf1[2048];
+ size_t transformed1_length = sizeof (buf1);
+ char *transformed1 = U_NORMXFRM (s1, n1, nf, buf1, &transformed1_length);
if (transformed1 == NULL)
/* errno is set here. */
return -1;
/* Normalize and transform S2. */
- transformed2_length = sizeof (buf2);
- transformed2 = U_NORMXFRM (s2, n2, nf, buf2, &transformed2_length);
+ char buf2[2048];
+ size_t transformed2_length = sizeof (buf2);
+ char *transformed2 = U_NORMXFRM (s2, n2, nf, buf2, &transformed2_length);
if (transformed2 == NULL)
{
if (transformed1 != buf1)
@@ -57,8 +51,8 @@ FUNC (const UNIT *s1, size_t n1, const UNIT *s2, size_t n2,
}
/* Compare the transformed strings. */
- cmp = memcmp2 (transformed1, transformed1_length,
- transformed2, transformed2_length);
+ int cmp = memcmp2 (transformed1, transformed1_length,
+ transformed2, transformed2_length);
if (cmp < 0)
cmp = -1;
else if (cmp > 0)