Fix using environmental variables on WIN32.

This commit is contained in:
Daniel Kouril 2019-07-15 14:34:04 +02:00 committed by Frank Morgner
parent 709fa98bb5
commit 916434f3a2
1 changed files with 2 additions and 2 deletions

View File

@ -181,9 +181,9 @@ sc_ctx_win32_get_config_value(const char *name_env,
return SC_ERROR_INVALID_ARGUMENTS;
if (name_env) {
char *value = value = getenv(name_env);
char *value = getenv(name_env);
if (value) {
if (strlen(value) < *out_len)
if (strlen(value) > *out_len)
return SC_ERROR_NOT_ENOUGH_MEMORY;
memcpy(out, value, strlen(value));
*out_len = strlen(value);