G
Googler
Sorry about my mistake in subject.
I was asking about swprintf not snwprintf.
Anyway one more question.
int swprintf(wchar_t * restrict s,size_t n,const wchar_t * restrict
ormat, ...);
The swprintf function returns the number of wide characters written in
the array, not counting the terminating null wide character, or a neg
ative value if an encoding error occurred or if n or more wide
characters were requested to be written.
So here count is a size_t & return is an int.
So what happens if I pass in a value greater than that can be fitted
into a signed int - won't the return value get totally broken in that
case ?
i.e. I pass in
wchar_t s[INT_MAX + 10];
swprintf(s,INT_MAX + 5, somereallybigbuffer);
In this case, my buffer s is big enough to write INT_MAX + 5, however,
swprintf will not be able to return INT_MAX + 5 because it returns an
int.
I was asking about swprintf not snwprintf.
Anyway one more question.
int swprintf(wchar_t * restrict s,size_t n,const wchar_t * restrict
ormat, ...);
The swprintf function returns the number of wide characters written in
the array, not counting the terminating null wide character, or a neg
ative value if an encoding error occurred or if n or more wide
characters were requested to be written.
So here count is a size_t & return is an int.
So what happens if I pass in a value greater than that can be fitted
into a signed int - won't the return value get totally broken in that
case ?
i.e. I pass in
wchar_t s[INT_MAX + 10];
swprintf(s,INT_MAX + 5, somereallybigbuffer);
In this case, my buffer s is big enough to write INT_MAX + 5, however,
swprintf will not be able to return INT_MAX + 5 because it returns an
int.