Your version of gcc is a bit picky about sprintf. It assumes that "%02d-%02d", i.e. 5 characters + terminating zero, won't fit in a string buffer 10 bytes long. And the compiler might just be right sometimes :-).

A proper fix requires to use snprintf and check that the buffer was big enough to format the string and handle the error if the buffer is too small. I have no time to do that right now.

In the meantime, simply increase the buffer sizes until the compiler stops complaining. In your case, simply change monthnum and daynum to be 200 bytes long and it should make the compiler happy:

char monthnum[200];
char daynum[200];

You can do the same thing with other similar errors in the source code.