diff options
author | Bruno Haible <bruno@clisp.org> | 2020-09-05 15:24:53 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-09-05 15:29:58 +0200 |
commit | 13457cbc5281c271fa198c4302badca33931268a (patch) | |
tree | 3fcc456c0b14ed45ddf209805071490fbfad9a57 /lib/unistr | |
parent | b58bf6ee39a6a114550a6bb68e7db5262c17f8bf (diff) | |
download | gnulib-13457cbc5281c271fa198c4302badca33931268a.tar.gz |
unistr/u{8,16,32}-uctomb: Avoid possible trouble with huge strings.
* lib/unistr.in.h (u8_uctomb_aux, u8_uctomb, u16_uctomb_aux, u16_uctomb,
u32_uctomb): Change type of last argument to ptrdiff_t.
* lib/unistr/u8-uctomb.c (u8_uctomb): Likewise.
* lib/unistr/u8-uctomb-aux.c (u8_uctomb_aux): Likewise.
* lib/unistr/u16-uctomb.c (u16_uctomb): Likewise.
* lib/unistr/u16-uctomb-aux.c (u16_uctomb_aux): Likewise.
* lib/unistr/u32-uctomb.c (u32_uctomb): Likewise.
Diffstat (limited to 'lib/unistr')
-rw-r--r-- | lib/unistr/u16-uctomb-aux.c | 2 | ||||
-rw-r--r-- | lib/unistr/u16-uctomb.c | 2 | ||||
-rw-r--r-- | lib/unistr/u32-uctomb.c | 2 | ||||
-rw-r--r-- | lib/unistr/u8-uctomb-aux.c | 2 | ||||
-rw-r--r-- | lib/unistr/u8-uctomb.c | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/lib/unistr/u16-uctomb-aux.c b/lib/unistr/u16-uctomb-aux.c index a136b0a348..44fbdd5b3d 100644 --- a/lib/unistr/u16-uctomb-aux.c +++ b/lib/unistr/u16-uctomb-aux.c @@ -21,7 +21,7 @@ #include "unistr.h" int -u16_uctomb_aux (uint16_t *s, ucs4_t uc, int n) +u16_uctomb_aux (uint16_t *s, ucs4_t uc, ptrdiff_t n) { if (uc < 0xd800) { diff --git a/lib/unistr/u16-uctomb.c b/lib/unistr/u16-uctomb.c index b4f2b88ed1..77e52e5b83 100644 --- a/lib/unistr/u16-uctomb.c +++ b/lib/unistr/u16-uctomb.c @@ -28,7 +28,7 @@ #if !HAVE_INLINE int -u16_uctomb (uint16_t *s, ucs4_t uc, int n) +u16_uctomb (uint16_t *s, ucs4_t uc, ptrdiff_t n) { if (uc < 0xd800) { diff --git a/lib/unistr/u32-uctomb.c b/lib/unistr/u32-uctomb.c index 53e835d189..73554f1dc6 100644 --- a/lib/unistr/u32-uctomb.c +++ b/lib/unistr/u32-uctomb.c @@ -28,7 +28,7 @@ #if !HAVE_INLINE int -u32_uctomb (uint32_t *s, ucs4_t uc, int n) +u32_uctomb (uint32_t *s, ucs4_t uc, ptrdiff_t n) { if (uc < 0xd800 || (uc >= 0xe000 && uc < 0x110000)) { diff --git a/lib/unistr/u8-uctomb-aux.c b/lib/unistr/u8-uctomb-aux.c index 0b5ec90642..4e66c95073 100644 --- a/lib/unistr/u8-uctomb-aux.c +++ b/lib/unistr/u8-uctomb-aux.c @@ -23,7 +23,7 @@ #include "attribute.h" int -u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n) +u8_uctomb_aux (uint8_t *s, ucs4_t uc, ptrdiff_t n) { int count; diff --git a/lib/unistr/u8-uctomb.c b/lib/unistr/u8-uctomb.c index 7cf3389632..395be77254 100644 --- a/lib/unistr/u8-uctomb.c +++ b/lib/unistr/u8-uctomb.c @@ -30,7 +30,7 @@ #if !HAVE_INLINE int -u8_uctomb (uint8_t *s, ucs4_t uc, int n) +u8_uctomb (uint8_t *s, ucs4_t uc, ptrdiff_t n) { if (uc < 0x80) { |