Swap calloc arguments to use them properly.
This commit is contained in:
@@ -46,7 +46,7 @@ main(int argc, char *argv[])
|
||||
|
||||
/* Build up test data. */
|
||||
ntests = 256 + 256 + 3;
|
||||
test_data = calloc(sizeof(*test_data), (size_t)ntests);
|
||||
test_data = calloc((size_t)ntests, sizeof(*test_data));
|
||||
for (i = 0; i < 256; i++) {
|
||||
/* lower case */
|
||||
test_data[i].value = i;
|
||||
|
@@ -69,7 +69,8 @@ int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
GETGROUPS_T *gidlist = NULL;
|
||||
int i, j, errors = 0, ntests = 0;
|
||||
size_t i;
|
||||
int j, errors = 0, ntests = 0;
|
||||
int ch, ngids;
|
||||
|
||||
initprogname(argc > 0 ? argv[0] : "parse_gids_test");
|
||||
|
@@ -360,7 +360,7 @@ parse_plugin(const char *entry, const char *conf_file, unsigned int lineno)
|
||||
options[nopts] = NULL;
|
||||
}
|
||||
|
||||
info = calloc(sizeof(*info), 1);
|
||||
info = calloc(1, sizeof(*info));
|
||||
if (info == NULL)
|
||||
goto oom;
|
||||
info->symbol_name = strndup(symbol, symlen);
|
||||
|
Reference in New Issue
Block a user