diff options
author | June McEnroe <programble@gmail.com> | 2016-10-09 23:25:34 -0400 |
---|---|---|
committer | June McEnroe <programble@gmail.com> | 2016-10-09 23:25:34 -0400 |
commit | 205a549154155984406c8f03925b9101b2f006ba (patch) | |
tree | b7b8b899782590fa18f0f9ca747fb78f6436abb0 | |
parent | Rewrite jrp (diff) | |
download | src-205a549154155984406c8f03925b9101b2f006ba.tar.gz src-205a549154155984406c8f03925b9101b2f006ba.zip |
Fix jrp snprintf len
I hate calculations like these.
-rwxr-xr-x | .bin/jrp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/.bin/jrp.c b/.bin/jrp.c index f3205924..cde2fcce 100755 --- a/.bin/jrp.c +++ b/.bin/jrp.c @@ -206,7 +206,7 @@ static char *prompt(EditLine *el __attribute((unused))) { static char buf[4096]; char *bufPtr = buf; for (qvalue *stackPtr = stack.limit - 1; stackPtr >= stack.ptr; --stackPtr) { - size_t bufLen = sizeof(buf) - (buf - bufPtr) - 2; + size_t bufLen = sizeof(buf) - (bufPtr - buf) - 2; switch (radix) { case 2: bufPtr += snprintf(bufPtr, bufLen, " %s", formatBin(*stackPtr)); break; case 8: bufPtr += snprintf(bufPtr, bufLen, " %lo", *stackPtr); break; |