Skip to content

Commit 333ff69

Browse files
peterejasonmp85
authored andcommitted
Use proper format specifier for int64
Using %ld for int64 is not portable. Use INT64_FORMAT, like core PostgreSQL.
1 parent 50bd772 commit 333ff69

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hll.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ check_metadata(multiset_t const * i_omp, multiset_t const * i_imp)
554554
ereport(ERROR,
555555
(errcode(ERRCODE_DATA_EXCEPTION),
556556
errmsg("explicit threshold does not match: "
557-
"source uses %ld and dest uses %ld",
557+
"source uses " INT64_FORMAT " and dest uses " INT64_FORMAT,
558558
i_imp->ms_expthresh, i_omp->ms_expthresh)));
559559
}
560560

@@ -674,9 +674,9 @@ multiset_tostring(multiset_t const * i_msp)
674674
// with the automatically determined value.
675675
//
676676
if (expthresh == -1)
677-
snprintf(expbuf, sizeof(expbuf), "%ld(%ld)", expthresh, expval);
677+
snprintf(expbuf, sizeof(expbuf), INT64_FORMAT "(%ld)", expthresh, expval);
678678
else
679-
snprintf(expbuf, sizeof(expbuf), "%ld", expthresh);
679+
snprintf(expbuf, sizeof(expbuf), INT64_FORMAT, expthresh);
680680

681681
// Allocate an initial return buffer.
682682
len = 1024;
@@ -1771,7 +1771,7 @@ hll_typmod_out(PG_FUNCTION_ARGS)
17711771
char * typmodstr;
17721772

17731773
memset(buffer, '\0', sizeof(buffer));
1774-
snprintf(buffer, sizeof(buffer), "(%d,%d,%ld,%d)",
1774+
snprintf(buffer, sizeof(buffer), "(%d,%d," INT64_FORMAT ",%d)",
17751775
log2m, regwidth, expthresh, sparseon);
17761776

17771777
len = strlen(buffer) + 1;

0 commit comments

Comments
 (0)