Fixes for format strings
Andreas Jaeger
aj@suse.de
Sat Dec 9 10:11:00 GMT 2000
>>>>> Jakub Jelinek writes:
Jakub> On Sat, Dec 09, 2000 at 07:03:47PM +0100, Andreas Jaeger wrote:
>> >>>>> Ulrich Drepper writes:
>>
>> > Andreas Jaeger <aj@suse.de> writes:
>> >> >> - sprintf (tmp, (base == 10 ? "%.*s%0*d" : "%.*s%0*X"), cp - last_str,
>> >> >> + sprintf (tmp, (base == 10 ? "%.*s%0*ld" : "%.*s%0*lX"), cp - last_str,
>> >> >> last_str, now->val.str.lenmb - (cp - last_str), from);
>> >>
>> >> > The is a pointer difference. Therefore use the t modifier (not l).
>> >>
>> >> `from' is not a pointer difference,
>>
>> Uli, sorry, I don't get it, I'm a bit confused.
>> > OK, then a cast to int is required.
>> Where?
Jakub> I think (int) (cp - last_str)
Thanks - that's not correct, but I got it now.
It should be:
sprintf (tmp, (base == 10 ? "%.*s%0*ld" : "%.*s%0*lX"), cp - last_str,
last_str, (int) (now->val.str.lenmb - (cp - last_str)), from);
Since lenmb is of type size_t.
Ok now?
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj
More information about the Libc-hacker
mailing list