Tweak le_set() for clarity in msystem.cpp

This commit is contained in:
Brian Cox 2017-03-26 00:28:04 -07:00
parent c931a13ecd
commit be0b374cad
1 changed files with 11 additions and 6 deletions

View File

@ -405,13 +405,18 @@ char *env;
*/
size_t p_size=0;
if (strchr(env, '=') == NULL) {
q = getenv(env);
/* is it defined locally? */
if ((q = getenv(env)) == NULL){
if (NULL == q) {
/* no -- don't define it here */
return(SE_NONE);
}
else if ((p = (char*)malloc((unsigned) (p_size = (strlen(env)+strlen(q)+2))))
== NULL){
size_t p_size = strlen(env) + strlen(q) + 2;
if ((p = (char*)malloc((unsigned)(p_size))) == NULL) {
ERMSG("ran out of memory");
return(SE_NOMEM);
}