artec_eplus48u.c: fix HOME env bug #315071 (from Jörg Frings-Fürst)

merge-requests/1/head
m. allan noah 2015-09-08 21:52:02 -04:00
rodzic ccf737af96
commit f8725993d3
2 zmienionych plików z 20 dodań i 1 usunięć

Wyświetl plik

@ -1,3 +1,6 @@
2015-19-08 m. allan noah <kitno455 at gmail dot com>
* backend/artec_eplus48u.c: fix HOME env bug #315071 (from Jörg Frings-Fürst)
2015-09-03 Rolf Bensch <rolf at bensch hyphen online dot de>
* backend/pixma_mp810.c: Canon Pixma MP990 needs specific reordering pixels
for 4800 dpi, patch from Guillaume Courtois.

Wyświetl plik

@ -67,7 +67,7 @@ Updates (C) 2001 by Henning Meier-Geinitz.
whether to permit this exception to apply to your modifications.
If you do not wish that, delete this exception notice. */
#define BUILD 11
#define BUILD 12
#include "../include/sane/config.h"
@ -3580,6 +3580,14 @@ load_calibration_data (Artec48U_Scanner * s)
s->calibrated = SANE_FALSE;
path[0] = 0;
/* return SANE_STATUS_INVAL if HOME environment variable is not set */
if (getenv ("HOME") == NULL)
{
XDBG ((1, "Environment variable HOME not set\n"));
return SANE_STATUS_INVAL;
}
if (strlen (getenv ("HOME")) < (PATH_MAX - 1))
strcat (path, getenv ("HOME"));
else
@ -3690,6 +3698,14 @@ save_calibration_data (Artec48U_Scanner * s)
mode_t mode = S_IRUSR | S_IWUSR;
path[0] = 0;
/* return SANE_STATUS_INVAL if HOME environment variable is not set */
if (getenv ("HOME") == NULL)
{
XDBG ((1, "Environment variable HOME not set\n"));
return SANE_STATUS_INVAL;
}
if (strlen (getenv ("HOME")) < (PATH_MAX - 1))
strcat (path, getenv ("HOME"));
else