diff options
Diffstat (limited to 'lib/unilbrk/u8-possible-linebreaks.c')
| -rw-r--r-- | lib/unilbrk/u8-possible-linebreaks.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/unilbrk/u8-possible-linebreaks.c b/lib/unilbrk/u8-possible-linebreaks.c index bc4796f4..86a8e941 100644 --- a/lib/unilbrk/u8-possible-linebreaks.c +++ b/lib/unilbrk/u8-possible-linebreaks.c @@ -1,5 +1,5 @@ /* Line breaking of UTF-8 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. @@ -457,7 +457,6 @@ read_file (FILE *stream) char *buf = NULL; int alloc = 0; int size = 0; - int count; while (! feof (stream)) { @@ -473,7 +472,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)) @@ -505,11 +504,10 @@ main (int argc, char * argv[]) char *input = read_file (stdin); int length = strlen (input); char *breaks = malloc (length); - int i; u8_possible_linebreaks_v2 ((uint8_t *) input, length, "UTF-8", breaks); - for (i = 0; i < length; i++) + for (int i = 0; i < length; i++) { switch (breaks[i]) { |
