From 972af7c5375c5a3f2fc28d23c348101dcc3eff10 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 31 May 2020 07:13:03 -0400 Subject: [PATCH] assetnameparser: Amend transposed fwrite arguments Existing code was using the size argument for the number of elements to write and vice versa. No behavior change, given this still results in the same number of bytes being copied. This just makes corrects their usages. --- assetnameparser/main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/assetnameparser/main.cpp b/assetnameparser/main.cpp index a4a2c6465..0a4d8d3a8 100644 --- a/assetnameparser/main.cpp +++ b/assetnameparser/main.cpp @@ -259,18 +259,18 @@ int main(int argc, const char* argv[]) uint32_t assetCount = SBig(uint32_t(assets.size())); FourCC sentinel(SBIG('AIDM')); - fwrite(&sentinel, 1, sizeof(sentinel), f.get()); - fwrite(&assetCount, 1, sizeof(assetCount), f.get()); + fwrite(&sentinel, sizeof(sentinel), 1, f.get()); + fwrite(&assetCount, sizeof(assetCount), 1, f.get()); for (const SAsset& asset : assets) { - fwrite(&asset.type, 1, sizeof(asset.type), f.get()); + fwrite(&asset.type, sizeof(asset.type), 1, f.get()); uint64_t id = SBig(asset.id); - fwrite(&id, 1, sizeof(id), f.get()); + fwrite(&id, sizeof(id), 1, f.get()); uint32_t tmp = SBig(uint32_t(asset.name.length())); - fwrite(&tmp, 1, sizeof(tmp), f.get()); + fwrite(&tmp, sizeof(tmp), 1, f.get()); fwrite(asset.name.c_str(), 1, SBig(tmp), f.get()); tmp = SBig(uint32_t(asset.dir.length())); - fwrite(&tmp, 1, sizeof(tmp), f.get()); - fwrite(asset.dir.c_str(), 1, SBig(tmp), f.get()); + fwrite(&tmp, sizeof(tmp), 1, f.get()); + fwrite(asset.dir.c_str(), SBig(tmp), 1, f.get()); } fflush(f.get()); return 0;