Skip to content

Commit

Permalink
color: fix attr_color_copy()
Browse files Browse the repository at this point in the history
  • Loading branch information
nabijaczleweli authored and flatcap committed Nov 4, 2023
1 parent a39a752 commit 24f8644
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions color/attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,10 @@ struct AttrColor *attr_color_list_find(struct AttrColorList *acl, color_t fg,
*/
struct AttrColor attr_color_copy(const struct AttrColor *ac)
{
struct AttrColor copy = { 0 };
if (ac)
copy = *ac;

return copy;
return *ac;
else
return (struct AttrColor){ 0 };
}

/**
Expand Down

0 comments on commit 24f8644

Please sign in to comment.