v1-0004-pg_locale_libc.c-add-missing-casts-to-unsigned-ch.patch
text/x-patch
Filename: v1-0004-pg_locale_libc.c-add-missing-casts-to-unsigned-ch.patch
Type: text/x-patch
Part: 3
Patch
Format: format-patch
Series: patch v1-0004
Subject: pg_locale_libc.c: add missing casts to unsigned char.
| File | + | − |
|---|---|---|
| src/backend/utils/adt/pg_locale_libc.c | 4 | 4 |
From 132781a2fbf1454c631b4cd116725f075895a7cb Mon Sep 17 00:00:00 2001
From: Jeff Davis <jeff@j-davis.com>
Date: Mon, 6 Jul 2026 12:02:54 -0700
Subject: [PATCH v1 4/4] pg_locale_libc.c: add missing casts to unsigned char.
Discussion: https://postgr.es/m/20260630012919.78@rfd.leadboat.com
Backpatch-through: 19
---
src/backend/utils/adt/pg_locale_libc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/backend/utils/adt/pg_locale_libc.c b/src/backend/utils/adt/pg_locale_libc.c
index 0043371586d..b50b3f24efd 100644
--- a/src/backend/utils/adt/pg_locale_libc.c
+++ b/src/backend/utils/adt/pg_locale_libc.c
@@ -527,7 +527,7 @@ strlower_libc_sb(char *dest, size_t destsize, const char *src, size_t srclen,
{
if (*p >= 'A' && *p <= 'Z')
*p += 'a' - 'A';
- else if (IS_HIGHBIT_SET(*p) && isupper_l(*p, loc))
+ else if (IS_HIGHBIT_SET(*p) && isupper_l((unsigned char) *p, loc))
*p = tolower_l((unsigned char) *p, loc);
}
else
@@ -611,14 +611,14 @@ strtitle_libc_sb(char *dest, size_t destsize, const char *src, size_t srclen,
{
if (*p >= 'A' && *p <= 'Z')
*p += 'a' - 'A';
- else if (IS_HIGHBIT_SET(*p) && isupper_l(*p, loc))
+ else if (IS_HIGHBIT_SET(*p) && isupper_l((unsigned char) *p, loc))
*p = tolower_l((unsigned char) *p, loc);
}
else
{
if (*p >= 'a' && *p <= 'z')
*p -= 'a' - 'A';
- else if (IS_HIGHBIT_SET(*p) && islower_l(*p, loc))
+ else if (IS_HIGHBIT_SET(*p) && islower_l((unsigned char) *p, loc))
*p = toupper_l((unsigned char) *p, loc);
}
}
@@ -713,7 +713,7 @@ strupper_libc_sb(char *dest, size_t destsize, const char *src, size_t srclen,
{
if (*p >= 'a' && *p <= 'z')
*p -= 'a' - 'A';
- else if (IS_HIGHBIT_SET(*p) && islower_l(*p, loc))
+ else if (IS_HIGHBIT_SET(*p) && islower_l((unsigned char) *p, loc))
*p = toupper_l((unsigned char) *p, loc);
}
else
--
2.43.0