summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-05-11 11:34:06 -0400
committermidipix <writeonce@midipix.org>2016-05-11 11:34:06 -0400
commit00dc83f5f65bf0809ae54847475c050bb801d574 (patch)
tree1cb9982772f0dd1d8cdb9e247947aaeb092f1392
parentb1a8141177703c05f5e3df9b73332503d6d2abeb (diff)
downloaddalist-00dc83f5f65bf0809ae54847475c050bb801d574.tar.bz2
dalist-00dc83f5f65bf0809ae54847475c050bb801d574.tar.xz
dalist_dbg_write_posix(): properly handle signedness.
-rw-r--r--src/dalist_debug.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dalist_debug.c b/src/dalist_debug.c
index 4461286..92cc5b1 100644
--- a/src/dalist_debug.c
+++ b/src/dalist_debug.c
@@ -91,8 +91,12 @@ static int dalist_dbg_write_posix(
bytes_written = pfn_write(fildes,buf,nbyte);
- if (bytes_written == nbyte)
+ if (bytes_written < 0)
+ return DALIST_EDEBUGENV;
+
+ else if (bytes_written == (ssize_t)nbyte)
return DALIST_OK;
+
else
return DALIST_EDEBUGENV;
}