Skip to content

Commit

Permalink
Merge pull request #15 from cgutman/constify_tooltip
Browse files Browse the repository at this point in the history
The tooltip member should be a const char* since the string data is just used as a source for strncpy(). This allows callers to initialize the tooltip member with a string literal without triggering a -Wwrite-strings warning.
  • Loading branch information
dmikushin authored May 12, 2024
2 parents 69a6107 + 7e431f8 commit 754b7fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tray.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extern "C"

struct tray {
const char *icon_filepath;
char *tooltip;
const char *tooltip;
void (*cb)(struct tray *); // called on left click, leave null to just open menu
struct tray_menu_item *menu;
};
Expand Down

0 comments on commit 754b7fc

Please sign in to comment.