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/gt68xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backend/gt68xx.c') diff --git a/backend/gt68xx.c b/backend/gt68xx.c index ea71d91..13efe91 100644 --- a/backend/gt68xx.c +++ b/backend/gt68xx.c @@ -2346,7 +2346,7 @@ sane_cancel (SANE_Handle handle) else { DBG (4, "sane_cancel: scan has not been initiated yet, " - "or it is allready aborted\n"); + "or it is already aborted\n"); } DBG (5, "sane_cancel: exit\n"); -- 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/gt68xx.c | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-) (limited to 'backend/gt68xx.c') diff --git a/backend/gt68xx.c b/backend/gt68xx.c index 13efe91..fb3bfb4 100644 --- a/backend/gt68xx.c +++ b/backend/gt68xx.c @@ -2,46 +2,46 @@ Copyright (C) 2002 Sergey Vlasov Copyright (C) 2002 - 2007 Henning Geinitz - Copyright (C) 2009 Stéphane Voltz for sheetfed + Copyright (C) 2009 Stéphane Voltz for sheetfed calibration code. This file is part of the SANE package. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - + As a special exception, the authors of SANE give permission for additional uses of the libraries contained in this release of SANE. - + The exception is that, if you link a SANE library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the SANE library code into it. - + This exception does not, however, invalidate any other reasons why the executable file might be covered by the GNU General Public License. - + If you submit changes to SANE to the maintainers to be included in a subsequent release, you agree by submitting the changes that those changes may be distributed with this exception intact. If you write modifications of your own for SANE, it is your choice whether to permit this exception to apply to your modifications. - If you do not wish that, delete this exception notice. + If you do not wish that, delete this exception notice. */ /* @@ -162,13 +162,6 @@ static SANE_Range y_range = { SANE_FIX (0.0) /* quantization */ }; - -static const SANE_Range offset_range = { - -63, /* minimum */ - 63, /* maximum */ - 1 /* quantization */ -}; - static SANE_Range gamma_range = { SANE_FIX (0.01), /* minimum */ SANE_FIX (5.0), /* maximum */ @@ -756,7 +749,7 @@ init_options (GT68xx_Scanner * s) s->opt[OPT_SENSOR_GROUP].desc = SANE_DESC_SENSORS; s->opt[OPT_SENSOR_GROUP].type = SANE_TYPE_GROUP; s->opt[OPT_SENSOR_GROUP].constraint_type = SANE_CONSTRAINT_NONE; - + /* calibration needed */ s->opt[OPT_NEED_CALIBRATION_SW].name = "need-calibration"; s->opt[OPT_NEED_CALIBRATION_SW].title = SANE_I18N ("Need calibration"); @@ -1487,7 +1480,7 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle) DBG (0, "WARNING: Your scanner is not fully supported or at least \n"); DBG (0, " had only limited testing. Please be careful and \n"); DBG (0, " report any failure/success to \n"); - DBG (0, " sane-devel@lists.alioth.debian.org. Please provide as many\n"); + DBG (0, " sane-devel@alioth-lists.debian.net. Please provide as many\n"); DBG (0, " details as possible, e.g. the exact name of your\n"); DBG (0, " scanner and what does (not) work.\n"); } @@ -1502,7 +1495,7 @@ sane_open (SANE_String_Const devicename, SANE_Handle * handle) DBG (0, " the scanner immediately if you hear unusual noise. \n"); DBG (0, " Please report any success to \n"); - DBG (0, " sane-devel@lists.alioth.debian.org. Please provide as many\n"); + DBG (0, " sane-devel@alioth-lists.debian.net. Please provide as many\n"); DBG (0, " details as possible, e.g. the exact name of your\n"); DBG (0, " scanner, ids, settings etc.\n"); @@ -1616,7 +1609,7 @@ sane_close (SANE_Handle handle) gt68xx_device_lamp_control (s->dev, SANE_FALSE, SANE_FALSE); dev = s->dev; - + free (s->val[OPT_MODE].s); free (s->val[OPT_GRAY_MODE_COLOR].s); free (s->val[OPT_SOURCE].s); @@ -1624,7 +1617,7 @@ sane_close (SANE_Handle handle) free ((void *)(size_t)s->opt[OPT_RESOLUTION].constraint.word_list); gt68xx_scanner_free (s); - + gt68xx_device_fix_descriptor (dev); gt68xx_device_deactivate (dev); @@ -1859,7 +1852,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option, status = gt68xx_sheetfed_scanner_calibrate (s); myinfo |= SANE_INFO_RELOAD_OPTIONS; break; - + case OPT_CLEAR_CALIBRATION: gt68xx_clear_calibration (s); myinfo |= SANE_INFO_RELOAD_OPTIONS; @@ -2045,14 +2038,14 @@ sane_start (SANE_Handle handle) { /* compute scan parameters */ scan_request.calculate = SANE_TRUE; - gt68xx_device_setup_scan (s->dev, &scan_request, SA_SCAN, &scan_params); + gt68xx_device_setup_scan (s->dev, &scan_request, SA_SCAN, &scan_params); /* restore settings from calibration stored */ memcpy(s->dev->afe,&(s->afe_params), sizeof(GT68xx_AFE_Parameters)); RIE (gt68xx_assign_calibration (s, scan_params)); scan_request.calculate = SANE_FALSE; } - + /* send scan request to the scanner */ RIE (gt68xx_scanner_start_scan (s, &scan_request, &scan_params)); @@ -2331,7 +2324,7 @@ sane_cancel (SANE_Handle handle) if (s->dev->model->flags & GT68XX_FLAG_SHEET_FED) { gt68xx_device_paperfeed (s->dev); - } + } else { sanei_usb_set_timeout (SHORT_TIMEOUT); -- 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/gt68xx.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'backend/gt68xx.c') diff --git a/backend/gt68xx.c b/backend/gt68xx.c index fb3bfb4..00190fe 100644 --- a/backend/gt68xx.c +++ b/backend/gt68xx.c @@ -752,7 +752,7 @@ init_options (GT68xx_Scanner * s) /* calibration needed */ s->opt[OPT_NEED_CALIBRATION_SW].name = "need-calibration"; - s->opt[OPT_NEED_CALIBRATION_SW].title = SANE_I18N ("Need calibration"); + s->opt[OPT_NEED_CALIBRATION_SW].title = SANE_I18N ("Needs calibration"); s->opt[OPT_NEED_CALIBRATION_SW].desc = SANE_I18N ("The scanner needs calibration for the current settings"); s->opt[OPT_NEED_CALIBRATION_SW].type = SANE_TYPE_BOOL; s->opt[OPT_NEED_CALIBRATION_SW].unit = SANE_UNIT_NONE; @@ -947,25 +947,30 @@ download_firmware_file (GT68xx_Device * dev) if (strncmp (dev->model->firmware_name, PATH_SEP, 1) != 0) { /* probably filename only */ - snprintf (filename, PATH_MAX, "%s%s%s%s%s%s%s", + snprintf (filename, sizeof(filename), "%s%s%s%s%s%s%s", STRINGIFY (PATH_SANE_DATA_DIR), PATH_SEP, "sane", PATH_SEP, "gt68xx", PATH_SEP, dev->model->firmware_name); - snprintf (dirname, PATH_MAX, "%s%s%s%s%s", + snprintf (dirname, sizeof(dirname), "%s%s%s%s%s", STRINGIFY (PATH_SANE_DATA_DIR), PATH_SEP, "sane", PATH_SEP, "gt68xx"); - strncpy (basename, dev->model->firmware_name, PATH_MAX); + strncpy (basename, dev->model->firmware_name, sizeof(basename) - 1); + basename[sizeof(basename) - 1] = '\0'; } else { /* absolute path */ char *pos; - strncpy (filename, dev->model->firmware_name, PATH_MAX); - strncpy (dirname, dev->model->firmware_name, PATH_MAX); + strncpy (filename, dev->model->firmware_name, sizeof(filename) - 1); + filename[sizeof(filename) - 1] = '\0'; + strncpy (dirname, dev->model->firmware_name, sizeof(dirname) - 1); + dirname[sizeof(dirname) - 1] = '\0'; + pos = strrchr (dirname, PATH_SEP[0]); if (pos) pos[0] = '\0'; - strncpy (basename, pos + 1, PATH_MAX); + strncpy (basename, pos + 1, sizeof(basename) - 1); + basename[sizeof(basename) - 1] = '\0'; } /* first, try to open with exact case */ @@ -994,11 +999,16 @@ download_firmware_file (GT68xx_Device * dev) { direntry = readdir (dir); if (direntry - && (strncasecmp (direntry->d_name, basename, PATH_MAX) == - 0)) + && (strncasecmp (direntry->d_name, basename, PATH_MAX) == 0)) { - snprintf (filename, PATH_MAX, "%s%s%s", - dirname, PATH_SEP, direntry->d_name); + int len = snprintf (filename, sizeof(filename), "%s%s%s", + dirname, PATH_SEP, direntry->d_name); + if ((len < 0) || (len >= (int) sizeof(filename))) + { + DBG (5, "download_firmware: filepath `%s%s%s' too long\n", + dirname, PATH_SEP, direntry->d_name); + status = SANE_STATUS_INVAL; + } break; } } -- cgit v1.2.3