Make sure prec is non-negative before calling getformat()
authortb <tb@openbsd.org>
Fri, 13 Aug 2021 10:40:23 +0000 (10:40 +0000)
committertb <tb@openbsd.org>
Fri, 13 Aug 2021 10:40:23 +0000 (10:40 +0000)
commit8b5f200da98efc14f8d43af38cd9e76fcbba9b46
tree8a6e82b8b9205e2c2e47b6ff6401ccd5971baa5d
parent2a75a88ed0607cc36f7659115e3f8c42b884e92f
Make sure prec is non-negative before calling getformat()

If jot is called without arguments, getformat() produces the illegal
"%.-1f" format string. __vfprintf() misinterprets the - as a left
adjust flag and uses a precision of 0. Set prec = 0 so that we use
"%.0f" in this situation.

ok martijn
usr.bin/jot/jot.c