mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 06:58:35 +00:00
coverity/109019: fixing "Sizeof not portable"
suspicious_sizeof: Passing argument 8UL /* sizeof (char const **) */ to function xcalloc and then casting the return value to char ** is suspicious. In this particular case sizeof (char const **) happens to be equal to sizeof (char const *), but this is not a portable as
This commit is contained in:
@@ -268,7 +268,7 @@ char **server_address_list(size_t *size)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char **addrs = xcalloc((size_t) servers.ga_len, sizeof(const char **));
|
char **addrs = xcalloc((size_t) servers.ga_len, sizeof(const char *));
|
||||||
for (int i = 0; i < servers.ga_len; i++) {
|
for (int i = 0; i < servers.ga_len; i++) {
|
||||||
addrs[i] = xstrdup(((Server **)servers.ga_data)[i]->addr);
|
addrs[i] = xstrdup(((Server **)servers.ga_data)[i]->addr);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user