Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
2931529
)
lib: Fixed another bufio bug.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Sun, 1 May 2016 02:57:51 +0000
(
04:57
+0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Sun, 1 May 2016 02:57:51 +0000
(
04:57
+0200)
lib/bufio.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/bufio.c
b/lib/bufio.c
index
83963b3
..
fe5d005
100644
(file)
--- a/
lib/bufio.c
+++ b/
lib/bufio.c
@@
-259,8
+259,10
@@
ssize_t biowritesome(struct bufio *bio, const void *data, size_t len)
if(bio->wh == bio->wbuf.d)
bio->wh = bio->wbuf.d = 0;
if(bio->wbuf.d == bio->wbuf.s) {
- if(bio->wh > 0)
+ if(bio->wh > 0)
{
memmove(bio->wbuf.b, bio->wbuf.b + bio->wh, bio->wbuf.d -= bio->wh);
+ bio->wh = 0;
+ }
}
ret = min(len, bio->wbuf.s - bio->wbuf.d);
memcpy(bio->wbuf.b + bio->wbuf.d, data, ret);