output/recorder: fix write() error check
We can only check for negative values if the variable is signed.
This commit is contained in:
parent
fbcbcdc001
commit
d34e55c370
1
NEWS
1
NEWS
|
@ -1,5 +1,6 @@
|
||||||
ver 0.17.3 (2012/??/??)
|
ver 0.17.3 (2012/??/??)
|
||||||
* output:
|
* output:
|
||||||
|
- recorder: fix I/O error check
|
||||||
- shout: fix memory leak in error handler
|
- shout: fix memory leak in error handler
|
||||||
|
|
||||||
ver 0.17.2 (2012/09/30)
|
ver 0.17.2 (2012/09/30)
|
||||||
|
|
|
@ -140,9 +140,9 @@ recorder_output_encoder_to_file(struct recorder_output *recorder,
|
||||||
|
|
||||||
size_t position = 0;
|
size_t position = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
size_t nbytes = write(recorder->fd,
|
ssize_t nbytes = write(recorder->fd,
|
||||||
recorder->buffer + position,
|
recorder->buffer + position,
|
||||||
size - position);
|
size - position);
|
||||||
if (nbytes > 0) {
|
if (nbytes > 0) {
|
||||||
position += (size_t)nbytes;
|
position += (size_t)nbytes;
|
||||||
if (position >= size)
|
if (position >= size)
|
||||||
|
|
Loading…
Reference in New Issue