Skip to content

Instantly share code, notes, and snippets.

@Congee
Created March 14, 2014 06:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Congee/9542967 to your computer and use it in GitHub Desktop.
Save Congee/9542967 to your computer and use it in GitHub Desktop.
Dangerous function gets() in C89, c99's <stdio.h>
#include <stdio.h>
int main(void) {
char a[] = "ABCD";
char b[] = "BCDE";
char c[] = "CDEF";
puts(a);
puts(b);
puts(c);
puts("Enter some characters");
gets(b);
puts(a);
puts(b);
puts(c);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment