~mdw
/
dvdrip
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
chkdvdimg.c: Factor out `set_status' subroutine.
[dvdrip]
/
lib.c
diff --git
a/lib.c
b/lib.c
index
320f04d
..
2147228
100644
(file)
--- a/
lib.c
+++ b/
lib.c
@@
-137,6
+137,19
@@
double tvdiff(const struct timeval *tv_lo, const struct timeval *tv_hi)
(tv_hi->tv_usec - tv_lo->tv_usec)/1.0e6);
}
(tv_hi->tv_usec - tv_lo->tv_usec)/1.0e6);
}
+int read_line(FILE *fp, struct buf *b)
+{
+ int ch;
+
+ ch = getc(fp);
+ if (ch == EOF)
+ return (-1);
+ else if (ch != '\n')
+ do { buf_putc(b, ch); ch = getc(fp); } while (ch != EOF && ch != '\n');
+ buf_putz(b);
+ return (0);
+}
+
void carefully_write(int fd, const void *buf, size_t sz)
{
const unsigned char *p = buf;
void carefully_write(int fd, const void *buf, size_t sz)
{
const unsigned char *p = buf;