Cannot rely on %z printf length modifier.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Sun, 5 Oct 2014 06:21:45 +0000 (09:21 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Sun, 5 Oct 2014 06:57:07 +0000 (09:57 +0300)
Before version 9.4, we didn't require sprintf to support the %z length
modifier. Use %lu instead.

Reported by Peter Eisentraut. Apply to 9.3 and earlier.

src/backend/access/gist/gist.c

index da045a45813f7d34e1ae8cf4ad397cdcf88bbca5..dd03b351b53fbc6082b7f8ed4b522c0d626ec881 100644 (file)
@@ -961,8 +961,9 @@ gistSplit(Relation r,
    if (len == 1)
        ereport(ERROR,
                (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
-           errmsg("index row size %zu exceeds maximum %zu for index \"%s\"",
-                  IndexTupleSize(itup[0]), GiSTPageSize,
+           errmsg("index row size %lu exceeds maximum %lu for index \"%s\"",
+                  (unsigned long) IndexTupleSize(itup[0]),
+                  (unsigned long) GiSTPageSize,
                   RelationGetRelationName(r))));
 
    memset(v.spl_lisnull, TRUE, sizeof(bool) * giststate->tupdesc->natts);