Allocator sizeof operand mismatch

Result of 'calloc' is converted to a pointer of type 'char *', which
is incompatible with sizeof operand type 'char **'
This commit is contained in:
Antonin Décimo 2019-08-02 18:46:11 +02:00 committed by Simon Ser
parent 6e0565e9de
commit 7e5c2d7afa

View file

@ -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;