From: dv Date: Sun, 4 Feb 2024 14:53:12 +0000 (+0000) Subject: Reverse calloc args. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=160bdb598b92ab1858cb0222d65e1024623127bf;p=openbsd Reverse calloc args. Found by smatch "double check that we're allocating correct size" warning. Reported by and ok jsg@. --- diff --git a/usr.sbin/vmd/fw_cfg.c b/usr.sbin/vmd/fw_cfg.c index b875082b6fe..3e9459baede 100644 --- a/usr.sbin/vmd/fw_cfg.c +++ b/usr.sbin/vmd/fw_cfg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fw_cfg.c,v 1.7 2023/02/06 20:33:34 dv Exp $ */ +/* $OpenBSD: fw_cfg.c,v 1.8 2024/02/04 14:53:12 dv Exp $ */ /* * Copyright (c) 2018 Claudio Jeker * @@ -396,7 +396,7 @@ fw_cfg_add_file(const char *name, const void *data, size_t len) if (fw_cfg_lookup_file(name)) fatalx("%s: fw_cfg: file %s exists", __progname, name); - if ((f = calloc(sizeof(*f), 1)) == NULL) + if ((f = calloc(1, sizeof(*f))) == NULL) fatal("%s", __func__); if ((f->data = malloc(len)) == NULL)