diff options
author | NIIBE Yutaka <[email protected]> | 2020-08-19 05:48:06 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2020-08-19 05:48:06 +0000 |
commit | f58d441bee7e93e6344f833acc1412b3be2f6818 (patch) | |
tree | ad3d46a908d6c29a17ab17c3cd9647215674ddcd /common/iobuf.c | |
parent | Silence compiler warnings. (diff) | |
download | gnupg-f58d441bee7e93e6344f833acc1412b3be2f6818.tar.gz gnupg-f58d441bee7e93e6344f833acc1412b3be2f6818.zip |
common: Fix iobuf.c.
* common/iobuf.c (iobuf_cancel): Initialize DUMMY.
(do_iobuf_fdopen): Initialize LEN.
(iobuf_read_line): Fix the loop condition.
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'common/iobuf.c')
-rw-r--r-- | common/iobuf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/iobuf.c b/common/iobuf.c index a00ee0b37..f9c788a7b 100644 --- a/common/iobuf.c +++ b/common/iobuf.c @@ -1267,7 +1267,7 @@ iobuf_cancel (iobuf_t a) /* send a cancel message to all filters */ for (a2 = a; a2; a2 = a2->chain) { - size_t dummy; + size_t dummy = 0; if (a2->filter) a2->filter (a2->filter_ov, IOBUFCTRL_CANCEL, a2->chain, NULL, &dummy); } @@ -1413,7 +1413,7 @@ do_iobuf_fdopen (int fd, const char *mode, int keep_open) iobuf_t a; gnupg_fd_t fp; file_filter_ctx_t *fcx; - size_t len; + size_t len = 0; fp = INT2FD (fd); @@ -2708,7 +2708,7 @@ iobuf_read_line (iobuf_t a, byte ** addr_of_buffer, /* We reached the buffer's size limit! */ { /* Skip the rest of the line. */ - while (c != '\n' && (c = iobuf_get (a)) != -1) + while ((c = iobuf_get (a)) != -1 && c != '\n') ; /* p is pointing at the last byte in the buffer. We |