diff --git a/convert.c b/convert.c
index 352b69d4ceeec411a81469a6146e023aa1d6b338..1816e977b7b13782003fc78a9de9b47cd3554a32 100644 (file)
--- a/convert.c
+++ b/convert.c
else
stats->printable++;
}
+
+ /* If file ends with EOF then don't count this EOF as non-printable. */
+ if (size >= 1 && buf[size-1] == '\032')
+ stats->nonprintable--;
}
/*
* (child --> cmd) --> us
*/
int ret = 1;
- struct strbuf nbuf;
+ struct strbuf nbuf = STRBUF_INIT;
struct async async;
struct filter_params params;
if (start_async(&async))
return 0; /* error was already reported */
- strbuf_init(&nbuf, 0);
if (strbuf_read(&nbuf, async.out, len) < 0) {
error("read from external filter %s failed", cmd);
ret = 0;