summaryrefslogtreecommitdiff
path: root/backend/artec_eplus48u.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-09-27 08:20:20 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-09-27 08:20:20 +0200
commite94622c319e4307617b202f19d3ec05b21a9bb49 (patch)
treec5ddf44352b9bd47aeb3eb432ba79638079efe25 /backend/artec_eplus48u.c
parent6f2255c9648b175d51e2c8e5e9670557f9dc4ee1 (diff)
merge to 1.0.25+git20150927
Diffstat (limited to 'backend/artec_eplus48u.c')
-rw-r--r--backend/artec_eplus48u.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/backend/artec_eplus48u.c b/backend/artec_eplus48u.c
index c26fbb0..bc3b2f8 100644
--- a/backend/artec_eplus48u.c
+++ b/backend/artec_eplus48u.c
@@ -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