summaryrefslogtreecommitdiffstats
path: root/usr.sbin/fifolog/lib
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/fifolog/lib')
-rw-r--r--usr.sbin/fifolog/lib/fifolog_create.c2
-rw-r--r--usr.sbin/fifolog/lib/fifolog_reader.c4
-rw-r--r--usr.sbin/fifolog/lib/fifolog_write_poll.c2
-rw-r--r--usr.sbin/fifolog/lib/miniobj.h2
4 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/fifolog/lib/fifolog_create.c b/usr.sbin/fifolog/lib/fifolog_create.c
index 4a7c333..17f38c9 100644
--- a/usr.sbin/fifolog/lib/fifolog_create.c
+++ b/usr.sbin/fifolog/lib/fifolog_create.c
@@ -97,7 +97,7 @@ fifolog_create(const char *fn, off_t size, ssize_t recsize)
if (S_ISREG(st.st_mode) && ftruncate(fd, size) < 0)
return ("Could not ftrunc");
- buf = calloc(recsize, 1);
+ buf = calloc(1, recsize);
if (buf == NULL)
return ("Could not malloc");
diff --git a/usr.sbin/fifolog/lib/fifolog_reader.c b/usr.sbin/fifolog/lib/fifolog_reader.c
index 5843a81..0dda672 100644
--- a/usr.sbin/fifolog/lib/fifolog_reader.c
+++ b/usr.sbin/fifolog/lib/fifolog_reader.c
@@ -67,10 +67,10 @@ fifolog_reader_open(const char *fname)
if (retval != NULL)
err(1, "%s", retval);
- fr->olen = fr->ff->recsize * 16;
- fr->obuf = calloc(fr->olen, 1);
+ fr->obuf = calloc(16, fr->ff->recsize);
if (fr->obuf == NULL)
err(1, "Cannot malloc");
+ fr->olen = fr->ff->recsize * 16;
i = inflateInit(fr->ff->zs);
assert(i == Z_OK);
diff --git a/usr.sbin/fifolog/lib/fifolog_write_poll.c b/usr.sbin/fifolog/lib/fifolog_write_poll.c
index 9ebd5be..885ba7f 100644
--- a/usr.sbin/fifolog/lib/fifolog_write_poll.c
+++ b/usr.sbin/fifolog/lib/fifolog_write_poll.c
@@ -45,7 +45,7 @@
static int fifolog_write_gzip(struct fifolog_writer *f, time_t now);
#define ALLOC(ptr, size) do { \
- (*(ptr)) = calloc(size, 1); \
+ (*(ptr)) = calloc(1, size); \
assert(*(ptr) != NULL); \
} while (0)
diff --git a/usr.sbin/fifolog/lib/miniobj.h b/usr.sbin/fifolog/lib/miniobj.h
index dd79be1..ee94a10 100644
--- a/usr.sbin/fifolog/lib/miniobj.h
+++ b/usr.sbin/fifolog/lib/miniobj.h
@@ -28,7 +28,7 @@
#define ALLOC_OBJ(to, type_magic) \
do { \
- (to) = calloc(sizeof *(to), 1); \
+ (to) = calloc(1, sizeof *(to)); \
if ((to) != NULL) \
(to)->magic = (type_magic); \
} while (0)
OpenPOWER on IntegriCloud