summaryrefslogtreecommitdiff
path: root/lib/uniwbrk/ulc-wordbreaks.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2026-03-10 13:24:07 +0100
committerJörg Frings-Fürst <debian@jff.email>2026-03-10 13:24:07 +0100
commitcfd1f17f1a85d95ea12bca8dae42add7dad1ad11 (patch)
tree8016486f8ee7157213f2d09ff2491bfa9c94638a /lib/uniwbrk/ulc-wordbreaks.c
parent14e4d584d0121031ec40e6c35869745f1747ff29 (diff)
parent1403307d6e2fb4e7b5d97a35f40d1e95134561ab (diff)
Merge branch 'release/debian/1.4.2-1'HEADdebian/1.4.2-1master
Diffstat (limited to 'lib/uniwbrk/ulc-wordbreaks.c')
-rw-r--r--lib/uniwbrk/ulc-wordbreaks.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/uniwbrk/ulc-wordbreaks.c b/lib/uniwbrk/ulc-wordbreaks.c
index 75293611..c904b73e 100644
--- a/lib/uniwbrk/ulc-wordbreaks.c
+++ b/lib/uniwbrk/ulc-wordbreaks.c
@@ -1,5 +1,5 @@
/* Word breaks in strings.
- Copyright (C) 2001-2003, 2006-2024 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2006-2026 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2009.
This file is free software.
@@ -66,25 +66,22 @@ ulc_wordbreaks (const char *s, size_t n, char *p)
if (offsets != NULL)
{
- uint8_t *t;
size_t m;
-
- t = u8_conv_from_encoding (encoding, iconveh_question_mark,
- s, n, offsets, NULL, &m);
+ uint8_t *t =
+ u8_conv_from_encoding (encoding, iconveh_question_mark,
+ s, n, offsets, NULL, &m);
if (t != NULL)
{
char *q = (char *) (m > 0 ? malloc (m) : NULL);
if (m == 0 || q != NULL)
{
- size_t i;
-
/* Determine the word breaks of the UTF-8 string. */
u8_wordbreaks (t, m, q);
/* Translate the result back to the original string. */
memset (p, 0, n);
- for (i = 0; i < n; i++)
+ for (size_t i = 0; i < n; i++)
if (offsets[i] != (size_t)(-1))
p[i] = q[offsets[i]];
@@ -130,7 +127,6 @@ read_file (FILE *stream)
char *buf = NULL;
int alloc = 0;
int size = 0;
- int count;
while (! feof (stream))
{
@@ -146,7 +142,7 @@ read_file (FILE *stream)
exit (1);
}
}
- count = fread (buf + size, 1, BUFSIZE, stream);
+ int count = fread (buf + size, 1, BUFSIZE, stream);
if (count == 0)
{
if (ferror (stream))
@@ -179,11 +175,10 @@ main (int argc, char * argv[])
char *input = read_file (stdin);
int length = strlen (input);
char *breaks = malloc (length);
- int i;
ulc_wordbreaks (input, length, breaks);
- for (i = 0; i < length; i++)
+ for (int i = 0; i < length; i++)
{
switch (breaks[i])
{