svn commit: r305212 - head/usr.bin/localedef
Marcelo Araujo
araujo at FreeBSD.org
Thu Sep 1 15:23:34 UTC 2016
Author: araujo
Date: Thu Sep 1 15:23:33 2016
New Revision: 305212
URL: https://svnweb.freebsd.org/changeset/base/305212
Log:
- Invert calloc(3) argument order.
MFC after: 4 weeks
Modified:
head/usr.bin/localedef/collate.c
Modified: head/usr.bin/localedef/collate.c
==============================================================================
--- head/usr.bin/localedef/collate.c Thu Sep 1 15:17:39 2016 (r305211)
+++ head/usr.bin/localedef/collate.c Thu Sep 1 15:23:33 2016 (r305212)
@@ -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;
}
More information about the svn-src-all
mailing list