Make sure max in fmtstr() doesn't overflow into negativity