the gets function is dangerous
gcc is correct. replacing gets with fgets, which takes a buffer size