This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Fixes for format strings


>>>>> Ulrich Drepper writes:

 > Andreas Jaeger <aj@suse.de> writes:
>> @@ -1482,7 +1482,7 @@
>> struct charseq *seq;
>> uint32_t wch;
>> 
>> -	  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, it's of type `unsigned long int'.
The pointer difference (cp -last_str) is used by the '*' parameter.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]