Commit b31554e8 authored by Jean-Paul Saman's avatar Jean-Paul Saman

examples/dvbinfo/dvbinfo.c: Unsigned compare against 0 (CID 17261)

pf_write() returns a ssize_t which was stored inside a size_t (an unsigned).
Later on this value was used in a check against 0.
parent a34a1126
......@@ -368,14 +368,14 @@ static int dvbinfo_process(dvbinfo_capture_t *capture)
if (param->output)
{
size_t size = param->pf_write(param->fd_out, buffer->p_data, buffer->i_size);
ssize_t size = param->pf_write(param->fd_out, buffer->p_data, buffer->i_size);
if (size < 0) /* error writing */
{
libdvbpsi_log(param, DVBINFO_LOG_ERROR,
"error (%d) writting to %s", errno, param->output);
break;
}
else if (size < buffer->i_size) /* short writting disk full? */
else if ((size_t)size < buffer->i_size) /* short writting disk full? */
{
libdvbpsi_log(param, DVBINFO_LOG_ERROR,
"error writting to %s (disk full?)", param->output);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment