This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[BUG] memccpy treats size_t as int


Hi newlib maintainers,

It's come to my attention that newlib's memccpy (libc/string/memccpy.c) casts the len0 argument from size_t (as required by the SUS) to int. On 64-bit Linux environments, this erroneously drops the high 32 bits. I'm not familiar enough with newlib to know whether this issue is isolated to memccpy or whether it's standard practice in the project. Just thought I'd report it!

More specifically:
  int   len =  len0;
should be:
  size_t len =  len0;

-David



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