Allocator sizeof operand mismatch

Result of 'calloc' is converted to a pointer of type 'char *', which
is incompatible with sizeof operand type 'char **'
master
Antonin Décimo 5 years ago committed by Simon Ser
parent 6e0565e9de
commit 7e5c2d7afa

@ -568,7 +568,7 @@ bool spawn_swaybg(void) {
}
}
char **cmd = calloc(1, sizeof(char **) * length);
char **cmd = calloc(length, sizeof(char *));
if (!cmd) {
sway_log(SWAY_ERROR, "Failed to allocate spawn_swaybg command");
return false;

Loading…
Cancel
Save