diff options
| author | Jörg Frings-Fürst <debian@jff.email> | 2026-03-10 13:24:07 +0100 |
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff.email> | 2026-03-10 13:24:07 +0100 |
| commit | cfd1f17f1a85d95ea12bca8dae42add7dad1ad11 (patch) | |
| tree | 8016486f8ee7157213f2d09ff2491bfa9c94638a /lib/uniconv/u-conv-from-enc.h | |
| parent | 14e4d584d0121031ec40e6c35869745f1747ff29 (diff) | |
| parent | 1403307d6e2fb4e7b5d97a35f40d1e95134561ab (diff) | |
Merge branch 'release/debian/1.4.2-1'HEADdebian/1.4.2-1master
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 31e30e1e..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-2024 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) |
