commit 65c3199cd26a559956ac0b377a0422d1c5bfe21e
parent 24f3b8e13178de97d817c633dd07aa8ef648a12d
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Sun, 14 May 2023 05:23:33 +0000
Fix undefined variable in pop_list() return
The _len pointer itself was set to the number of listings, not the
integer it references. This resulted in the value of that variable
being undefined in getmail().
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pop3.c b/pop3.c
@@ -1,4 +1,4 @@
-/* $Id: pop3.c,v 1.12 2023/05/14 04:08:04 jacob Exp $ */
+/* $Id: pop3.c,v 1.13 2023/05/14 05:23:33 jacob Exp $ */
/*
* Copyright (c) 2022, 2023 Jacob R. Edwards <jacob@jacobedwards.org>
@@ -327,7 +327,7 @@ pop_list(FILE *fp, int *_len)
listings = calloc(len, sizeof(*listings));
if (len == 0 || listings == NULL) {
if (_len)
- _len = 0;
+ *_len = 0;
return listings;
}