- Invert calloc(3) argument order.

MFC after:	4 weeks
This commit is contained in:
Marcelo Araujo 2016-09-01 15:23:33 +00:00
parent 3d1e0e0830
commit 4c22fda976
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=305212

View File

@ -490,7 +490,7 @@ define_collsym(char *name)
{
collsym_t *sym;
if ((sym = calloc(sizeof (*sym), 1)) == NULL) {
if ((sym = calloc(1, sizeof(*sym))) == NULL) {
fprintf(stderr,"out of memory");
return;
}
@ -536,7 +536,7 @@ get_collundef(char *name)
srch.name = name;
if ((ud = RB_FIND(collundefs, &collundefs, &srch)) == NULL) {
if (((ud = calloc(sizeof (*ud), 1)) == NULL) ||
if (((ud = calloc(1, sizeof(*ud))) == NULL) ||
((ud->name = strdup(name)) == NULL)) {
fprintf(stderr,"out of memory");
free(ud);
@ -561,7 +561,7 @@ get_collchar(wchar_t wc, int create)
srch.wc = wc;
cc = RB_FIND(collchars, &collchars, &srch);
if ((cc == NULL) && create) {
if ((cc = calloc(sizeof (*cc), 1)) == NULL) {
if ((cc = calloc(1, sizeof(*cc))) == NULL) {
fprintf(stderr, "out of memory");
return (NULL);
}
@ -793,7 +793,7 @@ define_collelem(char *name, wchar_t *wcs)
return;
}
if ((e = calloc(sizeof (*e), 1)) == NULL) {
if ((e = calloc(1, sizeof(*e))) == NULL) {
fprintf(stderr, "out of memory");
return;
}
@ -927,7 +927,7 @@ add_order_subst(void)
s = RB_FIND(substs_ref, &substs_ref[curr_weight], &srch);
if (s == NULL) {
if ((s = calloc(sizeof (*s), 1)) == NULL) {
if ((s = calloc(1, sizeof(*s))) == NULL) {
fprintf(stderr,"out of memory");
return;
}
@ -1035,7 +1035,7 @@ add_weight(int32_t ref, int pass)
if (RB_FIND(weights, &weights[pass], &srch) != NULL)
return;
if ((w = calloc(sizeof (*w), 1)) == NULL) {
if ((w = calloc(1, sizeof(*w))) == NULL) {
fprintf(stderr, "out of memory");
return;
}