Fix buffer allocation calculation in gitrawitem() - sacc - sacc(omys), simple console gopher client
git clone git://bitreich.org/sacc/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/sacc/
Log
Files
Refs
Tags
LICENSE
---
commit ad655e3c1be072eb6f0d1d61279028707c836a82
parent deb31cc5a1b686058273ec5e03d49564fee8e05b
Author: Quentin Rameau 
Date:   Sun, 10 Sep 2017 21:37:17 +0200

Fix buffer allocation calculation in gitrawitem()

Thanks to Hiltjo for reporting and testing the fix!

Diffstat:
  M sacc.c                              |       2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/sacc.c b/sacc.c
@@ -295,7 +295,7 @@ getrawitem(int sock)
         do {
                 bs -= n;
                 buf += n;
-                if (bs <= 1) {
+                if (bs < 1) {
                         raw = xreallocarray(raw, ++bn, BUFSIZ);
                         buf = raw + (bn-1) * BUFSIZ;
                         bs = BUFSIZ;