]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
inet_net_pton.c: use pg_ascii_tolower() rather than tolower().
authorJeff Davis <jdavis@postgresql.org>
Tue, 10 Jun 2025 18:23:20 +0000 (11:23 -0700)
committerJeff Davis <jdavis@postgresql.org>
Tue, 10 Jun 2025 18:23:20 +0000 (11:23 -0700)
Avoid dependence on setlocale(). No behavior change.

Discussion: https://postgr.es/m/9875f7f9-50f1-4b5d-86fc-ee8b03e8c162@eisentraut.org
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
src/backend/utils/adt/inet_net_pton.c

index ef2236d9f0430eae68594809f5a6d2e708402991..3b0db2a379937b667d67e43f47905a47281352b1 100644 (file)
@@ -115,8 +115,7 @@ inet_cidr_pton_ipv4(const char *src, u_char *dst, size_t size)
                src++;                                  /* skip x or X. */
                while ((ch = *src++) != '\0' && isxdigit((unsigned char) ch))
                {
-                       if (isupper((unsigned char) ch))
-                               ch = tolower((unsigned char) ch);
+                       ch = pg_ascii_tolower((unsigned char) ch);
                        n = strchr(xdigits, ch) - xdigits;
                        assert(n >= 0 && n <= 15);
                        if (dirty == 0)