Gotta use the right sscanf format. :(

This commit is contained in:
Dianne Skoll
2022-09-15 18:43:58 -04:00
parent 0c6ab3e607
commit ae7069c9cb

View File

@@ -645,7 +645,7 @@ SetMoonEntry(int jul, char const *moon)
}
msg[0] = 0;
if (sscanf(moon, "%d %*d %*d %31c", &phase, msg) < 4) {
if (sscanf(moon, "%d %*d %*d %31[^\x01]", &phase, msg) < 4) {
if (sscanf(moon, "%d", &phase) != 1) {
/* Malformed MOON special; ignore */
fprintf(stderr, "Oops 1\n");