aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-02-15 17:28:17 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2022-02-15 17:28:17 -0500
commit3b0ee7f583dc347c4aecb57d35830d2f99956e5c (patch)
treef56adbfef07fa439a06220882b59d088755b15c2
parent4c1a1a347a47df7c17b0fd212436ccbb896c47ca (diff)
downloadpostgresql-3b0ee7f583dc347c4aecb57d35830d2f99956e5c.tar.gz
postgresql-3b0ee7f583dc347c4aecb57d35830d2f99956e5c.zip
Ensure that length argument of memcmp() isn't seen as negative.
I think this will shut up a weird warning from buildfarm member serinus. Perhaps it'd be better to change tsCompareString's length arguments to unsigned, but that seems more invasive than is justified. Part of a general push to remove off-the-beaten-track warnings where we can easily do so.
-rw-r--r--src/backend/utils/adt/tsvector_op.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/tsvector_op.c b/src/backend/utils/adt/tsvector_op.c
index 3a138186f1f..8ba9ef22f56 100644
--- a/src/backend/utils/adt/tsvector_op.c
+++ b/src/backend/utils/adt/tsvector_op.c
@@ -1167,7 +1167,7 @@ tsCompareString(char *a, int lena, char *b, int lenb, bool prefix)
}
else
{
- cmp = memcmp(a, b, Min(lena, lenb));
+ cmp = memcmp(a, b, Min((unsigned int) lena, (unsigned int) lenb));
if (prefix)
{