;printf("\nTruncation examples:\n");intret = snprintf_s_tester("<<<%d>>>",1221, _TRUNCATE );printf(" truncation %s occur\n", ret ==-1?"did":"did not"); ret = snprintf_s_tester("<<<%d>>>",121, _TRUNCATE );printf(" truncation %s occur\n", ret ==-1?"did...
then _snprintf_s returns the number of characters written (not including the terminating null); otherwise, _snprintf_s returns -1 to indicate that truncation occurred.
test.c: In function ‘main’: test.c:9:44: error:‘/ruaruarua’ directive output truncated writing 10 bytes into a region of size 4 [-Werror=format-truncation=] snprintf(cache, sizeof(LENGTH), "%s/ruaruarua", cache); ~~~^~~~ test.c:9:5: note: ‘snprintf’ output 11 or more...
then _snprintf_s returns the number of characters written (not including the terminating null); otherwise, _snprintf_s returns -1 to indicate that truncation occurred.