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 <drepper@redhat.com> writes:

|> Andreas Jaeger <aj@suse.de> writes:
|> 
|> > 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);
|> 
|> Not quite.  You also have to change
|> 
|>   cp - last_str
|> 
|> to
|>   (int) (cp - last_str)
|> 
|> as Jakub said.

Why?  What's wrong with substracting a ptrdiff_t from a size_t?

Andreas.

-- 
Andreas Schwab                                  "And now for something
SuSE Labs                                        completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg

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