From 6dca5715672fa66ccc1e6d0fbc6f3ff28370896d Mon Sep 17 00:00:00 2001 From: ruti <> Date: Thu, 17 Oct 2024 09:44:18 +0300 Subject: [PATCH] Fix loop if pos count > 1 --- desync.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desync.c b/desync.c index 4f69f39..feae490 100644 --- a/desync.c +++ b/desync.c @@ -461,7 +461,7 @@ ssize_t desync(int sfd, char *buffer, size_t bfsize, int i = 0, r = 0, rc = 0; for (; r > 0 || i < dp.tlsrec_n; rc++, r--) { - if (!r) { + if (r <= 0) { part = dp.tlsrec[i]; r = part.r; i++; } @@ -495,7 +495,7 @@ ssize_t desync(int sfd, char *buffer, size_t bfsize, int i = 0, r = 0; for (; r > 0 || i < dp.parts_n; r--) { - if (!r) { + if (r <= 0) { part = dp.parts[i]; r = part.r; i++; }