00dc83 dalist_dbg_write_posix(): properly handle signedness.

Authored and Committed by midipix 8 years ago
    dalist_dbg_write_posix(): properly handle signedness.
    
        
file modified
+5 -1
src/dalist_debug.c CHANGED
@@ -91,8 +91,12 @@ static int dalist_dbg_write_posix(
91
91
92
92
bytes_written = pfn_write(fildes,buf,nbyte);
93
93
94
- if (bytes_written == nbyte)
94
+ if (bytes_written < 0)
95
+ return DALIST_EDEBUGENV;
96
+
97
+ else if (bytes_written == (ssize_t)nbyte)
95
98
return DALIST_OK;
99
+
96
100
else
97
101
return DALIST_EDEBUGENV;
98
102
}