Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'ustream.c')
-rw-r--r--ustream.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/ustream.c b/ustream.c
index 88f1332..fd43395 100644
--- a/ustream.c
+++ b/ustream.c
@@ -311,15 +311,13 @@ void ustream_fill_read(struct ustream *s, int len)
char *ustream_get_read_buf(struct ustream *s, int *buflen)
{
- char *data;
- int len;
+ char *data = NULL;
+ int len = 0;
if (s->r.head) {
len = s->r.head->tail - s->r.head->data;
- data = s->r.head->data;
- } else {
- len = 0;
- data = NULL;
+ if (len > 0)
+ data = s->r.head->data;
}
if (buflen)