summaryrefslogtreecommitdiff
path: root/lib/unilbrk/ulc-possible-linebreaks.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2026-03-08 17:28:33 +0100
committerJörg Frings-Fürst <debian@jff.email>2026-03-08 17:28:33 +0100
commit5f59a34ab747dde8ede7357f3431bf06bd6002fe (patch)
tree056a4477fd870d454d5be5868cddab829a47f4d2 /lib/unilbrk/ulc-possible-linebreaks.c
parent27dae84ed92f1ef0300263091972338d12e78348 (diff)
New upstream version 1.4.2upstream/1.4.2upstream
Diffstat (limited to 'lib/unilbrk/ulc-possible-linebreaks.c')
-rw-r--r--lib/unilbrk/ulc-possible-linebreaks.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/unilbrk/ulc-possible-linebreaks.c b/lib/unilbrk/ulc-possible-linebreaks.c
index 0dc1ff41..1e112b4b 100644
--- a/lib/unilbrk/ulc-possible-linebreaks.c
+++ b/lib/unilbrk/ulc-possible-linebreaks.c
@@ -1,5 +1,5 @@
/* Line breaking of strings.
- Copyright (C) 2001-2003, 2006-2025 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2006-2026 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2001.
This file is free software.
@@ -66,26 +66,23 @@ ulc_possible_linebreaks_internal (const char *s, size_t n, const char *encoding,
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 possible line breaks of the UTF-8
string. */
u8_possible_linebreaks_loop (t, m, encoding, cr, q);
/* Translate the result back to the original string. */
memset (p, UC_BREAK_PROHIBITED, 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]];
@@ -169,7 +166,6 @@ read_file (FILE *stream)
char *buf = NULL;
int alloc = 0;
int size = 0;
- int count;
while (! feof (stream))
{
@@ -185,7 +181,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))
@@ -218,11 +214,10 @@ main (int argc, char * argv[])
char *input = read_file (stdin);
int length = strlen (input);
char *breaks = malloc (length);
- int i;
ulc_possible_linebreaks_v2 (input, length, locale_charset (), breaks);
- for (i = 0; i < length; i++)
+ for (int i = 0; i < length; i++)
{
switch (breaks[i])
{