Re: small bug in to_char and TM prefix, in RC

Lists: pgsql-hackers
From: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us, kleptog(at)svana(dot)org
Cc: bruce(at)momjian(dot)us, pgsql-hackers(at)postgresql(dot)org
Subject: Re: small bug in to_char and TM prefix, in RC
Date: 2006-11-29 20:34:40
Message-ID: BAY114-F4BDCA1AE7999C89340888F9E40@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

>
>It's pretty much guaranteed not to work on multibyte characters,
>regardless of platform :-(. This did not matter for non-localized
>month/day names, but it does matter now.
>
>In the context of the existing code, the simplest solution would be
>to provide separate translations of "SUNDAY", "Sunday", "sunday" etc
>but this will not work for the planned strftime() change.
>

and what use modified pg_tolower only for TM fields? Like:

if (S_TM(suf))
{
strcpy(inout, localize_month(tm->tm_mon - 1));
str_towupper(inout);
}
else
{
strcpy(inout, months[tm->tm_mon - 1]);
str_toupper(inout);
}

regards

Pavel Stehule

_________________________________________________________________
Chcete sdilet sve obrazky a hudbu s prateli? http://messenger.msn.cz/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
Cc: kleptog(at)svana(dot)org, bruce(at)momjian(dot)us, pgsql-hackers(at)postgresql(dot)org
Subject: Re: small bug in to_char and TM prefix, in RC
Date: 2006-11-29 20:39:32
Message-ID: 4168.1164832772@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com> writes:
> str_towupper(inout);

Since this wouldn't be a length-preserving change, it seems a bit scary
to invent a function defined as above. (The whole question of buffer
overflow in to_char needs to be looked at anyway, probably.)

regards, tom lane