Comment 16 for bug 36036

Revision history for this message
Xavier Claessens (zdra) wrote :

I think the problem isn't the w_bytes. gettext should remove the %PRIuMAX and replace it by something like %llu. So w_bytes goes for the %llu and human_readable() is for %s in the string. The segfault comes because gettext doesn't replace %<PRIuMAX> by %llu so fprintf doesn't reconize %<PRIuMAX> and so he gives w_bytes to the %s, w_bytes isn't a string so it segfault. I you remove the w_bytes of course it doesn't segfault, but it doesn't realy solve the problem which is the %<PRIuMAX>.

grep PRIuMAX *
Binary file coreutils.mo matches

So coreutils is the only program which has PRIuMAX in translations. If you look at the fr.po (or what ever is your local) there is some %<PRIuMAX> is the translation strings.

I don't know how gettext works but I think the %<PRIuMAX> shouldn't appear in the .mo file. coreutils is the only package which has it... Does someone knows a package which has %PRIuMAX in the C code but not in the .mo file (or maybe it is removed by gettext in .pot or .po don't know) ? All I know by googling is that it seems that "PRIuMAX" is a special string that gettext should handle in some way. If you add "#, c-format" in the .po file and compile it the problem goes away because gettext does more tests and replace %<PRIuMAX> by something like %llu, that's the proof that %<PRIuMAX> shouldn't appear in .mo files.