Japin Li <japi...@hotmail.com> writes:
> Maybe, we should format it to string before for localization messages,
> like the following code snippet comes from pg_backup_tar.c.
> However, I do not think it is a good way.

>         snprintf(buf1, sizeof(buf1), INT64_FORMAT, (int64) len);
>         snprintf(buf2, sizeof(buf2), INT64_FORMAT, (int64) th->fileLen);
>         fatal("actual file length (%s) does not match expected (%s)",
>               buf1, buf2);

That used to be our standard practice before we switched to always
relying on our own snprintf.c.  Now, we know that "%lld" with an
explicit cast to long long will work, so that's the preferred method
for printing 64-bit values in localizable strings.  Not all of the old
code has been updated, though.

                        regards, tom lane


Reply via email to