Skip to content

Commit

Permalink
quick bugfix to remove unnecessary complexity that caused memory error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Wilkes committed Aug 1, 2020
1 parent 90a37d5 commit b55306a
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions pd/src/g_all_guis.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,6 @@ void iemgui_all_col2save(t_iemgui *x, t_symbol **bflcol)
bflcol[2] = color2symbol(x->x_lcol);
}

static void expand_shorthex(char *source, char *doubled)
{
while(*source)
{
*doubled++ = *source;
*doubled++ = *source++;
}
}

static int iemgui_getcolorarg(t_iemgui *x, int index, int argc, t_atom *argv)
{
char *classname;
Expand All @@ -215,11 +206,14 @@ static int iemgui_getcolorarg(t_iemgui *x, int index, int argc, t_atom *argv)
if ('#' == s->s_name[0])
{
char *start = s->s_name + 1, *end;
char expanded[6];
char expanded[7];
int len = strlen(start);
if (len == 3)
{
expand_shorthex(start, expanded);
sprintf(expanded, "%c%c%c%c%c%c",
start[0], start[0],
start[1], start[1],
start[2], start[2]);
start = expanded;
len = 6;
}
Expand Down

0 comments on commit b55306a

Please sign in to comment.