git: 2cefae4cf34e - main - Fix transposed arguments in call to calloc(). Reported by GCC 15 warning.
Kirk McKusick <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.cvs.src,gmane.os.freebsd.current.scm |
|---|---|
| Message-ID | <[email protected]> |
The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=2cefae4cf34e7d39fc3b27358d7d66a96b3b0056 commit 2cefae4cf34e7d39fc3b27358d7d66a96b3b0056 Author: Kirk McKusick <[email protected]> AuthorDate: 2026-08-17 19:15:09 +0000 Commit: Kirk McKusick <[email protected]> CommitDate: 2026-08-17 19:15:09 +0000 Fix transposed arguments in call to calloc(). Reported by GCC 15 warning. No functional change intended. Submitted by: Pedro Giffuni <[email protected]> MFC-after: 1 week --- sbin/restore/symtab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/restore/symtab.c b/sbin/restore/symtab.c index 3ae6bf20c7be..840ff54b0428 100644 --- a/sbin/restore/symtab.c +++ b/sbin/restore/symtab.c @@ -545,7 +545,7 @@ initsymtable(char *filename) panic("cannot stat symbol table file %s\n", filename); } tblsize = stbuf.st_size - sizeof(struct symtableheader); - base = calloc(sizeof(char), (unsigned)tblsize); + base = calloc((size_t)tblsize, sizeof(char)); if (base == NULL) panic("cannot allocate space for symbol table\n"); if (read(fd, base, (int)tblsize) < 0 ||