1 2 3 4 5 6 7 8 9 10 11 12 13
char buf[10]; extern void abort (void); extern int sprintf (char*, const char*, ...); int main() { int l = sprintf (buf, "foo\0bar"); if (l != 3) abort (); return 0; }