aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Schink <swo-dev@marcschink.de>2017-03-12 19:09:10 +0100
committerMarc Schink <swo-dev@marcschink.de>2017-03-12 19:18:20 +0100
commit735743a66ad8f80d00dade11cde8a525b03deeaf (patch)
tree36117dbbc422280ea317898748ec188bee8f7185
parent87be021559f1d37d7bf04306c778a767153c413f (diff)
Make use of LIBSWO_ERR_NO_SPACE
-rw-r--r--libswo/decoder.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libswo/decoder.c b/libswo/decoder.c
index c115d1b..dc2af25 100644
--- a/libswo/decoder.c
+++ b/libswo/decoder.c
@@ -516,6 +516,7 @@ static int handle_packet(struct libswo_context *ctx)
* @retval LIBSWO_OK Success.
* @retval LIBSWO_ERR Other error conditions.
* @retval LIBSWO_ERR_ARG Invalid arguments.
+ * @retval LIBSWO_ERR_NO_SPACE No space left.
*
* @since 0.1.0
*/
@@ -525,10 +526,10 @@ LIBSWO_API int libswo_feed(struct libswo_context *ctx, const uint8_t *buffer,
if (!ctx || !buffer)
return LIBSWO_ERR_ARG;
- if (buffer_write(ctx, buffer, length))
- return LIBSWO_OK;
+ if (!buffer_write(ctx, buffer, length))
+ return LIBSWO_ERR_NO_SPACE;
- return LIBSWO_ERR;
+ return LIBSWO_OK;
}
/**