summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Yuan <shengquan.yuan@intel.com>2012-12-27 18:00:30 +0800
committerAustin Yuan <shengquan.yuan@intel.com>2012-12-27 18:00:30 +0800
commit2e11d2273b2974a7d1959cbcaf8db5b8e9aedd9e (patch)
treec45719db892abb8c15d36f20f7725a96100ed575
parentdfd8d3c78382bcd49b04c41163f1202695494dcd (diff)
downloadlibva-2e11d2273b2974a7d1959cbcaf8db5b8e9aedd9e.tar.gz
va_parseConfig: still need to check env_value
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>
-rw-r--r--va/va.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/va/va.c b/va/va.c
index f9e1303..deff824 100644
--- 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;
}