commit - 59051566657ab3888ef841cf46cf0588bf57e746
commit + d671434bc76ec81a34e64ae0c164a831cbee4b0d
blob - 9b8e4639d4fc0b92950b8580bee8977779d83039
blob + e57ff67bbcef362e3a9763f72900a5475009c2ee
--- titan.c
+++ titan.c
buflen = fread(buf, 1, sizeof(buf), in);
w = iomux(ctx, sock, buf, buflen, resbuf, sizeof(resbuf));
- if (w == -1)
- errx(1, "I/O error: %s", tls_error(ctx));
+ if (w == -1) {
+ errstr = tls_error(ctx);
+ if (errstr == NULL)
+ errstr = "unexpected EOF";
+ errx(1, "I/O error: %s", errstr);
+ }
if (w != 0) {
if ((m = memmem(resbuf, w, "\r\n", 2)) == NULL)
errx(1, "invalid reply");