summaryrefslogtreecommitdiff
path: root/backend/artec_eplus48u.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-10-08 12:32:49 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-10-08 12:32:49 +0200
commitcfd27ef2ad8b005fd47ab41ef29b71d9e3d48201 (patch)
tree56cb8849a5df91b19b72fd4f48c79c343cd9bc5e /backend/artec_eplus48u.c
parentba8d09abe681600aad991f4a75e904615b7ed29f (diff)
Imported Upstream version 1.0.25upstream/1.0.25
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