Re: [COMMITTERS] pgsql/src/backend/lib (stringinfo.c) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [COMMITTERS] pgsql/src/backend/lib (stringinfo.c)
Date
Msg-id 6992.936884675@sss.pgh.pa.us
Whole thread Raw
In response to Re: [COMMITTERS] pgsql/src/backend/lib (stringinfo.c)  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
List pgsql-hackers
Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
>> Cope with versions of vsnprintf() written by people who
>> don't read man pages...

> RETURN VALUE
>        If the output was truncated, the return value is -1,
>        otherwise it is  the  number  of  characters  stored,  not
>        including the terminating null.

> Is this consistant with the behavior you see on Linux? It's a GNU
> library thing...

That is the behavior I saw on my Linux box, but the manpage installed
on the same box sez that the return value is equal to the passed buffer
size if there's an overrun.  Maybe the manpage is out of date.

Anyway, the fixed code copes with both conventions.

You'll need to re-initdb to get rid of the broken rules in your
database, but then things should be OK...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] Re: Problem enabling pltcl
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Vacuum analyze bug CAUGHT