commit 9c76822a4a94acc7d84416e43051c4f230761b7e
parent d76e19e58222672b494e520b41eb7330e10a494e
Author: Renev Pavel <an2qzavok@gmail.com>
Date: Fri, 14 Apr 2023 21:03:24 +0000
list: fix bugs
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/list/list.c b/src/list/list.c
@@ -35,7 +35,7 @@ readlist(int fd)
{
int i = 0, len = 0;
Cell *list = nil;
- for (;;) {
+ for (;; i++) {
if (i >= len) {
len += 256;
list = realloc(list, sizeof(Cell) * len);
@@ -63,7 +63,7 @@ int
writelist(int fd, Cell *cell)
{
int n = 0, r;
- for (;;) {
+ for (;; cell++) {
if ((r = write(fd, &cell->type, sizeof(u8int))) <= 0) return -1;
n += r;
if ((r = write(fd, &cell->count, sizeof(u32int))) <= 0) return -1;