The fact that this can be called with an incorrect `m` value and cause a segfault is troubling. If this isn't meant to be an externally facing function, it's a bit better, but still a concern. Could it be refactored so that the argument is `mdays` and the caller is responsible for doing the `MONTHDAYS[m]` lookup? I'm not sure if there's any way to do the `z` computation based on `mdays` instead of `m`.