ref: 0327c47b5ad83cd2a62a988435a9cae8fac2b78d
parent: 406a0c2b09277c1332b125afcba293a171a8b197
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Wed Jan 6 06:06:25 EST 2021
ivf: add "ivf: " prefix for errors
--- a/stream_ivf.c
+++ b/stream_ivf.c
@@ -154,13 +154,13 @@
else if(sz > s->bufsz){
if((buf = realloc(s->buf, sz)) == nil){
werrstr("frame is too big: %d bytes", sz);
- return -1;
+ goto err;
}
s->buf = buf;
}
if((n = Bread(s->b, buf, sz)) != sz){
werrstr("short read (%d < %d)", n, sz);
- return -1;
+ goto err;
}
f->buf = buf;
f->sz = sz;
@@ -167,6 +167,9 @@
f->timestamp = timestamp;
return 0;
+err:
+ werrstr("ivf: %r");
+ return -1;
}
static void