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

o Change fragments like: "i = strlen(foo); bar = xmalloc(i+1); strcpy(bar,foo)

   to "bar = xstrdup(foo);":
parent 270259dc
No related branches found
No related tags found
No related merge requests found
......@@ -72,7 +72,7 @@ int parse_command_line(int argc, char *argv[])
poptContext context;
int curr_opt;
int i = 0, rc = 0;
int rc = 0;
char *env_val = NULL;
static char *temp_state = NULL;
......
......@@ -33,6 +33,7 @@
#include "src/common/list.h"
#include "src/common/hostlist.h"
#include "src/common/xmalloc.h"
#include "src/common/xstring.h"
#include "src/sinfo/print.h"
#include "src/sinfo/sinfo.h"
......@@ -395,10 +396,9 @@ int _print_partition(sinfo_data_t * sinfo_data, int width,
_print_str("N/A", width, right_justify, true);
else {
char *tmp;
tmp = xmalloc(strlen(sinfo_data->part_info->name)+2);
strcpy(tmp, sinfo_data->part_info->name);
tmp = xstrdup(sinfo_data->part_info->name);
if (sinfo_data->part_info->default_part)
strcat(tmp, "*");
xstrcat(tmp, "*");
_print_str(tmp, width, right_justify, true);
xfree(tmp);
}
......
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