diff options
Diffstat (limited to 'src/widget-encodings.c')
| -rw-r--r-- | src/widget-encodings.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/widget-encodings.c b/src/widget-encodings.c index acc32b3..70de289 100644 --- a/src/widget-encodings.c +++ b/src/widget-encodings.c | |||
| @@ -538,9 +538,11 @@ bindle_encodings_src_fileno( | |||
| 538 | state->line_off = 0; | 538 | state->line_off = 0; |
| 539 | buff = state->buff; | 539 | buff = state->buff; |
| 540 | 540 | ||
| 541 | while ((len = read(cnf->state->fdin, &buff[state->buff_len], (state->buff_size-state->buff_len))) > 0) | 541 | while ((len = read(cnf->state->fdin, &buff[state->buff_len], (state->buff_size-state->buff_len))) >= 0) |
| 542 | { | 542 | { |
| 543 | state->buff_len += (size_t)len; | 543 | state->buff_len += (size_t)len; |
| 544 | if (state->buff_len == 0) | ||
| 545 | return(0); | ||
| 544 | buff[state->buff_len] = '\0'; | 546 | buff[state->buff_len] = '\0'; |
| 545 | if ((cnf->widget_flags & BINDLE_FLG_DECODE) == BINDLE_FLG_DECODE) | 547 | if ((cnf->widget_flags & BINDLE_FLG_DECODE) == BINDLE_FLG_DECODE) |
| 546 | { | 548 | { |
| @@ -551,7 +553,9 @@ bindle_encodings_src_fileno( | |||
| 551 | { | 553 | { |
| 552 | if (bindle_encodings_action_encode(cnf, method) == -1) | 554 | if (bindle_encodings_action_encode(cnf, method) == -1) |
| 553 | return(1); | 555 | return(1); |
| 554 | } | 556 | }; |
| 557 | if (len == 0) | ||
| 558 | return(0); | ||
| 555 | }; | 559 | }; |
| 556 | if (len == -1) | 560 | if (len == -1) |
| 557 | { | 561 | { |
