diff options
author | Dave Voutila <dv@cvs.openbsd.org> | 2024-02-04 14:53:13 +0000 |
---|---|---|
committer | Dave Voutila <dv@cvs.openbsd.org> | 2024-02-04 14:53:13 +0000 |
commit | 5f97c2624c334a0fba3ad1ae077855d408062075 (patch) | |
tree | 17ad0662185c271eddff77f204b92b8210e2f460 /usr.sbin | |
parent | 20ab75d75e635cb66e54c7eec290390a4aa02d57 (diff) |
Reverse calloc args.
Found by smatch "double check that we're allocating correct size"
warning. Reported by and ok jsg@.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/vmd/fw_cfg.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 <claudio@openbsd.org> * @@ -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) |