va_parseConfig: still need to check env_value
authorAustin Yuan <shengquan.yuan@intel.com>
Thu, 27 Dec 2012 10:00:30 +0000 (18:00 +0800)
committerAustin Yuan <shengquan.yuan@intel.com>
Thu, 27 Dec 2012 10:00:30 +0000 (18:00 +0800)
env_value may be NULL which means the caller doens't
care the value of the environment variable, just check
if it is set.

Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
va/va.c

diff --git a/va/va.c b/va/va.c
index f9e1303..deff824 100644 (file)
--- a/va/va.c
+++ b/va/va.c
@@ -89,7 +89,8 @@ int va_parseConfig(char *env, char *env_value)
     /* no setting in config file, use env setting */
     value = getenv(env);
     if (value) {
-        strncpy(env_value, value, 1024);
+        if (env_value)
+            strncpy(env_value, value, 1024);
         return 0;
     }