From d34e55c370db54ace2543d9801d360dae8e7c494 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 2 Oct 2012 00:00:56 +0200 Subject: output/recorder: fix write() error check We can only check for negative values if the variable is signed. --- NEWS | 1 + src/output/recorder_output_plugin.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 46963f308..a78002e97 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ ver 0.17.3 (2012/??/??) * output: + - recorder: fix I/O error check - shout: fix memory leak in error handler ver 0.17.2 (2012/09/30) diff --git a/src/output/recorder_output_plugin.c b/src/output/recorder_output_plugin.c index 5d098f08f..e2366bf90 100644 --- a/src/output/recorder_output_plugin.c +++ b/src/output/recorder_output_plugin.c @@ -140,9 +140,9 @@ recorder_output_encoder_to_file(struct recorder_output *recorder, size_t position = 0; while (true) { - size_t nbytes = write(recorder->fd, - recorder->buffer + position, - size - position); + ssize_t nbytes = write(recorder->fd, + recorder->buffer + position, + size - position); if (nbytes > 0) { position += (size_t)nbytes; if (position >= size) -- cgit v1.2.3