check for failues for hex_encode, cid#159

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24151 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-12-11 05:08:26 +00:00
parent 05708605e0
commit 1db27e217e

View File

@@ -1447,11 +1447,13 @@ hxtool_hex(struct hex_options *opt, int argc, char **argv)
errx(1, "fwrite failed");
}
} else {
char buf[28], *p;
size_t len;
char buf[28], *p;
ssize_t len;
while((len = fread(buf, 1, sizeof(buf), stdin)) != 0) {
len = hex_encode(buf, len, &p);
if (len < 0)
continue;
fprintf(stdout, "%s\n", p);
free(p);
}