Auto-generated C code doesn't leave space for the NUL-terminator

For those who don’t know C, strings in C are just character arrays ending with a NUL-terminator ('\0').

In some of the auto-generated C code, the space for the NUL-terminator isn’t reserved. For example, in “Heat Detector”, I can see

char BOMB_DIR[2]; // the direction of the bombs from batman's current location (U, UR, R, DR, D, DL, L or UL)
scanf("%s", BOMB_DIR);

It should be

char BOMB_DIR[3]; // the direction of the bombs from batman's current location (U, UR, R, DR, D, DL, L or UL)
scanf("%s", BOMB_DIR);

so that Undefined Behavior won’t strike. I’ve seen this problem in another challenge as well.

Please fix it.

Thank you for your bug report, I’ve fixed the issue to add an extra character in the array for the NUL-terminator. The patch is not released yet so I’ve updated directly the template to add an extra character for everyone.