]> git.sur5r.net Git - i3/i3/blobdiff - libi3/safewrappers.c
Merge pull request #3040 from jchook/next
[i3/i3] / libi3 / safewrappers.c
index f5973cab982185f869d0ed6b39eaf0ea80b67235..94ad4ee6c60a73fa4a28ae6cb4d353d9f5bfff4b 100644 (file)
@@ -5,6 +5,8 @@
  * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
  *
  */
+#include "libi3.h"
+
 #include <string.h>
 #include <stdlib.h>
 #include <stdarg.h>
@@ -13,8 +15,6 @@
 #include <err.h>
 #include <errno.h>
 
-#include "libi3.h"
-
 /*
  * The s* functions (safe) are wrappers around malloc, strdup, …, which exits if one of
  * the called functions returns NULL, meaning that there is no more memory available
@@ -27,10 +27,10 @@ void *smalloc(size_t size) {
     return result;
 }
 
-void *scalloc(size_t size) {
-    void *result = calloc(size, 1);
+void *scalloc(size_t num, size_t size) {
+    void *result = calloc(num, size);
     if (result == NULL)
-        err(EXIT_FAILURE, "calloc(%zd)", size);
+        err(EXIT_FAILURE, "calloc(%zd, %zd)", num, size);
     return result;
 }