kopia lustrzana https://gitlab.com/sane-project/backends
sanei: corrected fd validity check, which always used to fail.
rodzic
1ed4c7d8f5
commit
7a86b487bd
|
@ -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)
|
||||
|
|
Ładowanie…
Reference in New Issue