From 58912f68c2489bcee787599837447e0d64dfd61a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 24 May 2017 21:03:56 +0200 Subject: New upstream version 1.0.27 --- backend/umax_pp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'backend/umax_pp.c') diff --git a/backend/umax_pp.c b/backend/umax_pp.c index 90cd486..0f7ce4e 100644 --- a/backend/umax_pp.c +++ b/backend/umax_pp.c @@ -388,7 +388,7 @@ umax_pp_try_ports (SANEI_Config * config, char **ports) ports[i]); else DBG (3, - "umax_pp_try_ports: attach to port `%s' successfull\n", + "umax_pp_try_ports: attach to port `%s' successful\n", ports[i]); } free (ports[i]); @@ -1001,9 +1001,9 @@ sane_exit (void) for (i = 0; i < num_devices; i++) { free (devlist[i].port); - free (devlist[i].sane.name); - free (devlist[i].sane.model); - free (devlist[i].sane.vendor); + free ((void *) devlist[i].sane.name); + free ((void *) devlist[i].sane.model); + free ((void *) devlist[i].sane.vendor); } if (devlist != NULL) -- cgit v1.2.3 From 1687222e1b9e74c89cafbb5910e72d8ec7bfd40f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 31 Jul 2019 16:59:49 +0200 Subject: New upstream version 1.0.28 --- backend/umax_pp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'backend/umax_pp.c') diff --git a/backend/umax_pp.c b/backend/umax_pp.c index 0f7ce4e..b1121ef 100644 --- a/backend/umax_pp.c +++ b/backend/umax_pp.c @@ -1,5 +1,5 @@ /* sane - Scanner Access Now Easy. - Copyright (C) 2001-2012 Stéphane Voltz + Copyright (C) 2001-2012 Stéphane Voltz This file is part of the SANE package. This program is free software; you can redistribute it and/or @@ -41,10 +41,10 @@ This file implements a SANE backend for Umax PP flatbed scanners. */ /* CREDITS: - Started by being a mere copy of mustek_pp - by Jochen Eisinger - then evolved in its own thing - + Started by being a mere copy of mustek_pp + by Jochen Eisinger + then evolved in its own thing + support for the 610P has been made possible thank to an hardware donation from William Stuart */ -- cgit v1.2.3 From ffa8801644a7d53cc1c785e3450f794c07a14eb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 2 Feb 2020 17:13:01 +0100 Subject: New upstream version 1.0.29 --- backend/umax_pp.c | 47 +++++++++++++++++++---------------------------- 1 file changed, 19 insertions(+), 28 deletions(-) (limited to 'backend/umax_pp.c') diff --git a/backend/umax_pp.c b/backend/umax_pp.c index b1121ef..16adbe3 100644 --- a/backend/umax_pp.c +++ b/backend/umax_pp.c @@ -103,10 +103,6 @@ * 129 if you want to know which parameters are unused */ -/* history: - * see Changelog - */ - #define UMAX_PP_BUILD 2301 #define UMAX_PP_STATE "release" @@ -206,34 +202,28 @@ umax_pp_attach (SANEI_Config * config, const char *devname) SANE_Status status = SANE_STATUS_GOOD; int ret, prt = 0, mdl; char model[32]; - char name[64]; - char *val; - - memset (name, 0, 64); + const char *name = NULL; + const char *val; - if ((strlen (devname) < 3)) + if (!devname || (strlen (devname) < 3)) return SANE_STATUS_INVAL; sanei_umax_pp_setastra (atoi((SANE_Char *) config->values[CFG_ASTRA])); /* if the name begins with a slash, it's a device, else it's an addr */ - if (devname != NULL) + if ((devname[0] == '/')) { - if ((devname[0] == '/')) - { - strncpy (name, devname, 64); - } + name = devname; + } + else + { + if ((devname[0] == '0') + && ((devname[1] == 'x') || (devname[1] == 'X'))) + prt = strtol (devname + 2, NULL, 16); else - { - if ((devname[0] == '0') - && ((devname[1] == 'x') || (devname[1] == 'X'))) - prt = strtol (devname + 2, NULL, 16); - else - prt = atoi (devname); - } + prt = atoi (devname); } - for (i = 0; i < num_devices; i++) { if (devname[0] == '/') @@ -295,7 +285,7 @@ umax_pp_attach (SANEI_Config * config, const char *devname) devname); return SANE_STATUS_IO_ERROR; } - sprintf (model, "Astra %dP", mdl); + snprintf (model, sizeof(model), "Astra %dP", mdl); dev = malloc (sizeof (Umax_PP_Descriptor) * (num_devices + 1)); @@ -319,12 +309,12 @@ umax_pp_attach (SANEI_Config * config, const char *devname) num_devices++; /* if there are user provided values, use them */ - val=(SANE_Char *) config->values[CFG_NAME]; + val=(const SANE_Char *) config->values[CFG_NAME]; if(strlen(val)==0) dev->sane.name = strdup (devname); else dev->sane.name = strdup (val); - val=(SANE_Char *) config->values[CFG_VENDOR]; + val=(const SANE_Char *) config->values[CFG_VENDOR]; if(strlen(val)==0) dev->sane.vendor = strdup ("UMAX"); else @@ -351,11 +341,11 @@ umax_pp_attach (SANEI_Config * config, const char *devname) dev->max_h_size = 2550; dev->max_v_size = 3500; } - val=(SANE_Char *) config->values[CFG_MODEL]; + val=(const SANE_Char *) config->values[CFG_MODEL]; if(strlen(val)==0) - dev->sane.model = strdup (model); + dev->sane.model = strdup (model); else - dev->sane.model = strdup (val); + dev->sane.model = strdup (val); DBG (3, "umax_pp_attach: device %s attached\n", devname); @@ -1462,6 +1452,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, if (info) *info |= SANE_INFO_RELOAD_PARAMS; + // fall through case OPT_GRAY_GAIN: case OPT_GREEN_GAIN: case OPT_RED_GAIN: -- cgit v1.2.3