mirror of
https://github.com/postgres/postgres.git
synced 2026-10-23 13:29:09 +03:00
Fix callers of unicode_strtitle() using srclen == -1.
Currently, only called that way in tests, which failed to fail. Discussion: https://postgr.es/m/581a72ff452bb045ba83bbe3c6cf4467702d4f0f.camel@j-davis.com Backpatch-through: 18
This commit is contained in:
@@ -91,7 +91,7 @@ strtitle_builtin(char *dest, size_t destsize, const char *src, ssize_t srclen,
|
||||
{
|
||||
struct WordBoundaryState wbstate = {
|
||||
.str = src,
|
||||
.len = srclen,
|
||||
.len = (srclen < 0) ? strlen(src) : srclen,
|
||||
.offset = 0,
|
||||
.posix = !locale->info.builtin.casemap_full,
|
||||
.init = false,
|
||||
|
||||
@@ -303,7 +303,7 @@ tfunc_title(char *dst, size_t dstsize, const char *src,
|
||||
{
|
||||
struct WordBoundaryState wbstate = {
|
||||
.str = src,
|
||||
.len = srclen,
|
||||
.len = (srclen < 0) ? strlen(src) : srclen,
|
||||
.offset = 0,
|
||||
.init = false,
|
||||
.prev_alnum = false,
|
||||
|
||||
Reference in New Issue
Block a user