kopia lustrzana https://gitlab.com/sane-project/backends
check pointer received from sane_control_option()
rodzic
dfe765e251
commit
b35cbffda9
28
backend/hp.c
28
backend/hp.c
|
@ -43,9 +43,12 @@
|
|||
HP Scanner Control Language (SCL).
|
||||
*/
|
||||
|
||||
static char *hp_backend_version = "1.02";
|
||||
static char *hp_backend_version = "1.03";
|
||||
/* Changes:
|
||||
|
||||
V 1.03, 14-Apr-2003, PK (peter@kirchgessner.net)
|
||||
- check valp in call of sane_control_option()
|
||||
|
||||
V 1.02, 02-Feb-2003, PK (peter@kirchgessner.net)
|
||||
- add OS/2-support by Franz Bakan
|
||||
|
||||
|
@ -880,6 +883,29 @@ sane_control_option (SANE_Handle handle, SANE_Int optnum,
|
|||
|
||||
DBG(10, "sane_control_option called\n");
|
||||
|
||||
status = SANE_STATUS_GOOD;
|
||||
switch (action)
|
||||
{
|
||||
case SANE_ACTION_GET_VALUE:
|
||||
case SANE_ACTION_SET_VALUE:
|
||||
if (!valp)
|
||||
{
|
||||
DBG (1,"sane_control_option: valp is NULL\n");
|
||||
status = SANE_STATUS_INVAL;
|
||||
}
|
||||
break;
|
||||
|
||||
case SANE_ACTION_SET_AUTO:
|
||||
break;
|
||||
|
||||
default:
|
||||
DBG (1,"sane_control_option: action unknown\n");
|
||||
status = SANE_STATUS_INVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
if (status != SANE_STATUS_GOOD) return status;
|
||||
|
||||
status = sanei_hp_handle_control(h, optnum, action, valp, info);
|
||||
|
||||
DBG(10, "sane_control_option will finish with %s\n",
|
||||
|
|
Ładowanie…
Reference in New Issue