mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07: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:
parent
0b03399b8b
commit
2393074d5f
@ -268,7 +268,7 @@ char **server_address_list(size_t *size)
|
||||
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++) {
|
||||
addrs[i] = xstrdup(((Server **)servers.ga_data)[i]->addr);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user