diff options
| author | Jörg Frings-Fürst <debian@jff.email> | 2026-03-08 17:28:33 +0100 |
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff.email> | 2026-03-08 17:28:33 +0100 |
| commit | 5f59a34ab747dde8ede7357f3431bf06bd6002fe (patch) | |
| tree | 056a4477fd870d454d5be5868cddab829a47f4d2 /lib/uniconv/u-conv-from-enc.h | |
| parent | 27dae84ed92f1ef0300263091972338d12e78348 (diff) | |
New upstream version 1.4.2upstream/1.4.2upstream
Diffstat (limited to 'lib/uniconv/u-conv-from-enc.h')
| -rw-r--r-- | lib/uniconv/u-conv-from-enc.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/uniconv/u-conv-from-enc.h b/lib/uniconv/u-conv-from-enc.h index 32251c5e..4371d2b1 100644 --- a/lib/uniconv/u-conv-from-enc.h +++ b/lib/uniconv/u-conv-from-enc.h @@ -1,5 +1,5 @@ /* Conversion to UTF-16/UTF-32 from legacy encodings. - Copyright (C) 2002, 2006-2007, 2009-2025 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2026 Free Software Foundation, Inc. This file is free software. It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+". @@ -40,9 +40,8 @@ FUNC (const char *fromcode, { /* Convert 'char *' offsets to 'UNIT *' offsets. */ size_t *offsets_end = offsets + srclen; - size_t *o; - for (o = offsets; o < offsets_end; o++) + for (size_t *o = offsets; o < offsets_end; o++) if (*o != (size_t)(-1)) *o = *o / sizeof (UNIT); } @@ -51,16 +50,14 @@ FUNC (const char *fromcode, *lengthp = length / sizeof (UNIT); return (UNIT *) result; #else - uint8_t *utf8_string; size_t utf8_length; - UNIT *result; - - utf8_string = + uint8_t *utf8_string = u8_conv_from_encoding (fromcode, handler, src, srclen, offsets, NULL, &utf8_length); if (utf8_string == NULL) return NULL; - result = U8_TO_U (utf8_string, utf8_length, resultbuf, lengthp); + + UNIT *result = U8_TO_U (utf8_string, utf8_length, resultbuf, lengthp); if (result == NULL) { int saved_errno = errno; @@ -72,11 +69,10 @@ FUNC (const char *fromcode, { size_t length = *lengthp; size_t *offsets_end = offsets + srclen; - size_t *o; - size_t off8 = 0; /* offset into utf8_string */ - size_t offunit = 0; /* offset into result */ - for (o = offsets; o < offsets_end; o++) + size_t off8 = 0; /* offset into utf8_string */ + size_t offunit = 0; /* offset into result */ + for (size_t *o = offsets; o < offsets_end; o++) if (*o != (size_t)(-1)) { while (off8 < *o) |
