From 3cfda9858d43600c5ef857838fa2c8f4eb2a1deb Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 18 Nov 2018 18:06:33 +0000 Subject: [PATCH] Use tabledivide64() in Gv_GetArrayCountFromFile() git-svn-id: https://svn.eduke32.com/eduke32@7157 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/gamevars.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/duke3d/src/gamevars.cpp b/source/duke3d/src/gamevars.cpp index 54f7c9f49..1c8215a76 100644 --- a/source/duke3d/src/gamevars.cpp +++ b/source/duke3d/src/gamevars.cpp @@ -581,7 +581,10 @@ size_t __fastcall Gv_GetArrayCountFromFile(int const arrayIdx, size_t const file size_t const elementSize = Gv_GetArrayElementSize(arrayIdx); size_t const denominator = min(elementSize, sizeof(uint32_t)); - return (filelength + denominator - 1) / denominator; + + Bassert(denominator); + + return tabledivide64(filelength + denominator - 1, denominator); } int __fastcall Gv_GetArrayValue(int const id, int index)