diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-08-05 01:05:08 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-08-05 01:05:08 +0200 |
commit | 5bbeb516aa3539e30fccf228d5ac31381209a578 (patch) | |
tree | 6526c11c4220a5bc47d63449070e4dc328fd61a1 | |
parent | 53fcf3add0521b83e8b5226e6660d2ec9548f48c (diff) |
simple: split data/length validity checks into two
-rw-r--r-- | src/pulse/simple.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pulse/simple.c b/src/pulse/simple.c index b5e108fb..1e0f3e18 100644 --- a/src/pulse/simple.c +++ b/src/pulse/simple.c @@ -276,7 +276,8 @@ int pa_simple_write(pa_simple *p, const void*data, size_t length, int *rerror) { pa_assert(p); CHECK_VALIDITY_RETURN_ANY(rerror, p->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE, -1); - CHECK_VALIDITY_RETURN_ANY(rerror, data && length, PA_ERR_INVALID, -1); + CHECK_VALIDITY_RETURN_ANY(rerror, data, PA_ERR_INVALID, -1); + CHECK_VALIDITY_RETURN_ANY(rerror, length > 0, PA_ERR_INVALID, -1); pa_threaded_mainloop_lock(p->mainloop); @@ -315,7 +316,8 @@ int pa_simple_read(pa_simple *p, void*data, size_t length, int *rerror) { pa_assert(p); CHECK_VALIDITY_RETURN_ANY(rerror, p->direction == PA_STREAM_RECORD, PA_ERR_BADSTATE, -1); - CHECK_VALIDITY_RETURN_ANY(rerror, data && length, PA_ERR_INVALID, -1); + CHECK_VALIDITY_RETURN_ANY(rerror, data, PA_ERR_INVALID, -1); + CHECK_VALIDITY_RETURN_ANY(rerror, length > 0, PA_ERR_INVALID, -1); pa_threaded_mainloop_lock(p->mainloop); |