Skip to content
Snippets Groups Projects
Commit 8fb8fa9a authored by rswindell's avatar rswindell
Browse files

read_attr_cfg only reallocs the colors array when grows beyond MIN_COLORS.

parent e6b7320e
No related branches found
No related tags found
No related merge requests found
......@@ -438,8 +438,9 @@ BOOL read_attr_cfg(scfg_t* cfg, char* error)
for(cfg->total_colors=0;!feof(instream) && !ferror(instream);cfg->total_colors++) {
if(readline(&offset,str,4,instream)==NULL)
break;
if((p=realloc(cfg->color,cfg->total_colors+1))==NULL)
break;
if(cfg->total_colors>=MIN_COLORS)
if((p=realloc(cfg->color,cfg->total_colors+1))==NULL)
break;
cfg->color=p;
cfg->color[cfg->total_colors]=attrstr(str);
}
......
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