…at least when there’s no hint about the exact arguments you’re supposed to use.
Guess what parameters should you pass for sprintf(buf, _("memo_li_kb"), ...)
?
- Nothing
0
(float)0.0
(long long)0
- None of the above
Would it help if I told you valgrind is reporting Conditional jump or move depends on uninitialised value(s)
if you use 2)?
As it happens the format string in this case is
but since the compiler never sees the format string (only the unique ID) it has no way of warning you when the argument type doesn’t match the format (%lld kB
). In fact all the “help” you get from the compiler is constant stream of false warnings (warning: long long int format, different type arg (arg 2)
)
warning: too many arguments for format
Now, repeat the exercise for unique IDs
and sfil_li_size_100B_10kB
. You can probably guess the valid range in both cases, but see if it helps you 🙂
sfil_li_size_10kB_100kB
As an added twist after the format string bug was fixed the dialog in which it was shown was truncating the strings it was supposed to be showing. Earlier the string would be something like
because of the few uninitialised bytes, which is pretty much longer than the “correct” 4611910937274744832 kB
.
0 kB
Fix one bug and another one shows up. What else is new?