@@ -2124,14 +2124,7 @@ pg_strxfrm_libc(char *dest, const char *src, size_t destsize,
2124
2124
pg_locale_t locale )
2125
2125
{
2126
2126
Assert (locale -> provider == COLLPROVIDER_LIBC );
2127
-
2128
- #ifdef TRUST_STRXFRM
2129
2127
return strxfrm_l (dest , src , destsize , locale -> info .lt );
2130
- #else
2131
- /* shouldn't happen */
2132
- PGLOCALE_SUPPORT_ERROR (locale -> provider );
2133
- return 0 ; /* keep compiler quiet */
2134
- #endif
2135
2128
}
2136
2129
2137
2130
static size_t
@@ -2340,6 +2333,10 @@ pg_strxfrm_enabled(pg_locale_t locale)
2340
2333
* The provided 'src' must be nul-terminated. If 'destsize' is zero, 'dest'
2341
2334
* may be NULL.
2342
2335
*
2336
+ * Not all providers support pg_strxfrm() safely. The caller should check
2337
+ * pg_strxfrm_enabled() first, otherwise this function may return wrong
2338
+ * results or an error.
2339
+ *
2343
2340
* Returns the number of bytes needed (or more) to store the transformed
2344
2341
* string, excluding the terminating nul byte. If the value returned is
2345
2342
* 'destsize' or greater, the resulting contents of 'dest' are undefined.
@@ -2372,6 +2369,10 @@ pg_strxfrm(char *dest, const char *src, size_t destsize, pg_locale_t locale)
2372
2369
* 'src' does not need to be nul-terminated. If 'destsize' is zero, 'dest' may
2373
2370
* be NULL.
2374
2371
*
2372
+ * Not all providers support pg_strnxfrm() safely. The caller should check
2373
+ * pg_strxfrm_enabled() first, otherwise this function may return wrong
2374
+ * results or an error.
2375
+ *
2375
2376
* Returns the number of bytes needed (or more) to store the transformed
2376
2377
* string, excluding the terminating nul byte. If the value returned is
2377
2378
* 'destsize' or greater, the resulting contents of 'dest' are undefined.
@@ -2426,6 +2427,10 @@ pg_strxfrm_prefix_enabled(pg_locale_t locale)
2426
2427
*
2427
2428
* The provided 'src' must be nul-terminated.
2428
2429
*
2430
+ * Not all providers support pg_strxfrm_prefix() safely. The caller should
2431
+ * check pg_strxfrm_prefix_enabled() first, otherwise this function may return
2432
+ * wrong results or an error.
2433
+ *
2429
2434
* If destsize is not large enough to hold the resulting byte sequence, stores
2430
2435
* only the first destsize bytes in 'dest'. Returns the number of bytes
2431
2436
* actually copied to 'dest'.
@@ -2455,6 +2460,10 @@ pg_strxfrm_prefix(char *dest, const char *src, size_t destsize,
2455
2460
*
2456
2461
* The provided 'src' must be nul-terminated.
2457
2462
*
2463
+ * Not all providers support pg_strnxfrm_prefix() safely. The caller should
2464
+ * check pg_strxfrm_prefix_enabled() first, otherwise this function may return
2465
+ * wrong results or an error.
2466
+ *
2458
2467
* If destsize is not large enough to hold the resulting byte sequence, stores
2459
2468
* only the first destsize bytes in 'dest'. Returns the number of bytes
2460
2469
* actually copied to 'dest'.
0 commit comments