Rob Shearman rob@codeweavers.com writes:
At present, if the size of the buffer passed to snprintfW is too small then the function returns -1, as opposed to the required size of the buffer (as per C snprintf). This greatly limits its usefulness and can give incorrect results for those using the function that don't explicitly check for -1 being returned. A grep of the source tree shows that nothing depends on this behaviour.
Actually, something does depend on it: it is used to implement _vsnwprintf in ntdll, so you can't change it.
"Alexandre" == Alexandre Julliard julliard@winehq.org writes:
Alexandre> Rob Shearman rob@codeweavers.com writes: >> At present, if the size of the buffer passed to snprintfW is too >> small then the function returns -1, as opposed to the required size >> of the buffer (as per C snprintf). This greatly limits its usefulness >> and can give incorrect results for those using the function that >> don't explicitly check for -1 being returned. A grep of the source >> tree shows that nothing depends on this behaviour.
Alexandre> Actually, something does depend on it: it is used to Alexandre> implement _vsnwprintf in ntdll, so you can't change it.
Doesn't it sound like it's wrong for ntdll _vsnwprintf() to rely on a restricted implementation for snprintfW()?
Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de writes:
Doesn't it sound like it's wrong for ntdll _vsnwprintf() to rely on a restricted implementation for snprintfW()?
No, since we provide snprintfW ourselves we can decide how it should behave. We could of course have two different implementations but that doesn't really seem necessary.