++fmt increments the counter before it's read, so it'll point at the null terminator and enter the default case.
Edit: I guess it may not technically be a bug as it's just a small function, but using a single % instead of %% (which is what printf expects) would be a format error, hence prterror()