Merge branch '114-sane-backends-1-0-28-sanei-sanei_pio-c-3-bad-test' into 'master'

Resolve "sane-backends-1.0.28/sanei/sanei_pio.c: 3 * bad test ?"

Closes #114

See merge request sane-project/backends!362
fix-build-obselete-jpeg
Povilas Kanapickas 2020-03-22 12:34:05 +00:00
commit 6ab010939c
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -495,7 +495,7 @@ sanei_pio_close (int fd)
{
Port p = port + fd;
if ((0 > fd) && (NELEMS (port) <= fd))
if ((0 > fd) || (NELEMS (port) <= fd))
return;
if (!p->in_use)
@ -515,7 +515,7 @@ sanei_pio_close (int fd)
int
sanei_pio_read (int fd, u_char * buf, int n)
{
if ((0 > fd) && (NELEMS (port) <= fd))
if ((0 > fd) || (NELEMS (port) <= fd))
return -1;
if (!port[fd].in_use)
@ -527,7 +527,7 @@ sanei_pio_read (int fd, u_char * buf, int n)
int
sanei_pio_write (int fd, const u_char * buf, int n)
{
if ((0 > fd) && (NELEMS (port) <= fd))
if ((0 > fd) || (NELEMS (port) <= fd))
return -1;
if (!port[fd].in_use)