snprintf counts trailing NUL towards the char limit. Failing to account for that was causing an invalid value to be passed to pg_resetxlog -l, aborting the upgrade process.