mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Fix bogus assumption that sizeof() produces an int-sized result.
This commit is contained in:
@ -82,10 +82,10 @@ gtsvector_out(PG_FUNCTION_ARGS)
|
|||||||
outbuf = palloc( outbuf_maxlen );
|
outbuf = palloc( outbuf_maxlen );
|
||||||
|
|
||||||
if ( ISARRKEY(key) )
|
if ( ISARRKEY(key) )
|
||||||
sprintf( outbuf, ARROUTSTR, ARRNELEM(key) );
|
sprintf( outbuf, ARROUTSTR, (int) ARRNELEM(key) );
|
||||||
else {
|
else {
|
||||||
int cnttrue = ( ISALLTRUE(key) ) ? SIGLENBIT : sizebitvec(GETSIGN(key));
|
int cnttrue = ( ISALLTRUE(key) ) ? SIGLENBIT : sizebitvec(GETSIGN(key));
|
||||||
sprintf( outbuf, SINGOUTSTR, cnttrue, SIGLENBIT - cnttrue );
|
sprintf( outbuf, SINGOUTSTR, cnttrue, (int) SIGLENBIT - cnttrue );
|
||||||
}
|
}
|
||||||
|
|
||||||
PG_FREE_IF_COPY(key,0);
|
PG_FREE_IF_COPY(key,0);
|
||||||
|
Reference in New Issue
Block a user