Print this page
10100 Illumos is confused about calloc() arguments
@@ -19,10 +19,12 @@
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2018, Joyent, Inc.
*/
#include <libipmi.h>
#include <string.h>
@@ -35,11 +37,11 @@
static char errmsg[48];
if (msg)
*msg = NULL;
- if ((ihp = calloc(sizeof (ipmi_handle_t), 1)) == NULL) {
+ if ((ihp = calloc(1, sizeof (ipmi_handle_t))) == NULL) {
*errp = EIPMI_NOMEM;
if (msg)
*msg = "memory allocation failure";
return (NULL);
}