#define __STDC_WANT_LIB_EXT1__ 1
#include <stdio.h>
#include <string.h>
unsigned len_func(const char * ss, unsigned size) {
return (unsigned)strnlen_s(ss,size);
}
int main(int argc, char *argv[]) { (void)argv[argc];
printf("strnlen_s = %llu\n", strnlen_s("qwe",6));
printf("len_func = %u\n", len_func("qwe",6));
return 0;
}
Result in Debug 64-bit mode:
Quote
strnlen_s = 3
len_func = 12
Hi Prokrust,
I'm tried this today and you are right as far as I can tell. Same code w/o debug produces different results than with using debug mode.
John Z