mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
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 <gniibe@fsij.org>
This commit is contained in:
parent
f3e424d4e7
commit
f58d441bee
@ -1267,7 +1267,7 @@ iobuf_cancel (iobuf_t a)
|
|||||||
/* send a cancel message to all filters */
|
/* send a cancel message to all filters */
|
||||||
for (a2 = a; a2; a2 = a2->chain)
|
for (a2 = a; a2; a2 = a2->chain)
|
||||||
{
|
{
|
||||||
size_t dummy;
|
size_t dummy = 0;
|
||||||
if (a2->filter)
|
if (a2->filter)
|
||||||
a2->filter (a2->filter_ov, IOBUFCTRL_CANCEL, a2->chain, NULL, &dummy);
|
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;
|
iobuf_t a;
|
||||||
gnupg_fd_t fp;
|
gnupg_fd_t fp;
|
||||||
file_filter_ctx_t *fcx;
|
file_filter_ctx_t *fcx;
|
||||||
size_t len;
|
size_t len = 0;
|
||||||
|
|
||||||
fp = INT2FD (fd);
|
fp = INT2FD (fd);
|
||||||
|
|
||||||
@ -2708,7 +2708,7 @@ iobuf_read_line (iobuf_t a, byte ** addr_of_buffer,
|
|||||||
/* We reached the buffer's size limit! */
|
/* We reached the buffer's size limit! */
|
||||||
{
|
{
|
||||||
/* Skip the rest of the line. */
|
/* 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
|
/* p is pointing at the last byte in the buffer. We
|
||||||
|
Loading…
x
Reference in New Issue
Block a user