fork download
  1. #include <assert.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5.  
  6. int main(void) {
  7. char foo[2] = "\xff\xff";
  8. scanf("%01[^\n]", foo);
  9. if (foo[0] && foo[1]) {
  10. puts("foo has no '\\0' terminator!");
  11. }
  12. }
Success #stdin #stdout 0s 1836KB
stdin
This is my input.

Faulty, much?

stdout
foo has no '\0' terminator!