]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lib: fix warning about uninitialized variable 1.0.19
authorVincent Bernat <vincent@bernat.ch>
Sat, 11 Jan 2025 11:44:40 +0000 (12:44 +0100)
committerVincent Bernat <vincent@bernat.ch>
Sat, 11 Jan 2025 11:44:40 +0000 (12:44 +0100)
This is not really the case, but older compilers may not be able to
detect there is no branch when this variable is uninitialized.

src/lib/connection.c

index ce3bc9123e1c54dcf406222f13f5e8a98ee409c5..f323cb1ae00d04895d9f418cfbe04e3ec056a8c2 100644 (file)
@@ -64,7 +64,7 @@ static ssize_t
 sync_recv(lldpctl_conn_t *lldpctl, const uint8_t *data, size_t length, void *user_data)
 {
        struct lldpctl_conn_sync_t *conn = user_data;
-       ssize_t nb;
+       ssize_t nb = 0;
        size_t remain, offset = 0;
 
        if (conn->fd == -1 && ((conn->fd = sync_connect(lldpctl, conn)) == -1)) {