Skip to content
Snippets Groups Projects
Commit 270259dc authored by Mark Grondona's avatar Mark Grondona
Browse files

o change strcpys of environment vars to xstrdups

parent a4ed0bc9
No related branches found
No related tags found
No related merge requests found
...@@ -146,18 +146,12 @@ int parse_command_line(int argc, char *argv[]) ...@@ -146,18 +146,12 @@ int parse_command_line(int argc, char *argv[])
} }
if ( ( params.format == NULL ) && if ( ( params.format == NULL ) &&
( env_val = getenv("SINFO_FORMAT") ) ) { ( env_val = getenv("SINFO_FORMAT") ) )
i = strlen(env_val); params.format = xstrdup(env_val);
params.format = xmalloc(i);
strcpy(params.format, env_val);
}
if ( ( params.partition == NULL ) && if ( ( params.partition == NULL ) &&
( env_val = getenv("SINFO_PARTITION") ) ) { ( env_val = getenv("SINFO_PARTITION") ) )
i = strlen(env_val); params.partition = xstrdup(env_val);
params.partition = xmalloc(i);
strcpy(params.partition, env_val);
}
if ( params.format == NULL ) { if ( params.format == NULL ) {
if ( params.summarize ) if ( params.summarize )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment