Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit 2c5794a

Browse files
author
Philip de Nier
committed
MXFDump: fix precision warning from xcode
1 parent 68e2516 commit 2c5794a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

deps/libMXF/tools/MXFDump/MXFDump.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <stdlib.h>
4545
#include <string.h>
4646
#include <stdarg.h>
47+
#include <limits.h>
4748

4849
#if defined (_MSC_VER) && defined(_M_IX86) && defined(_WIN32)
4950
#define MXF_COMPILER_MSC_INTEL_WINDOWS
@@ -7179,11 +7180,11 @@ bool getInteger(int& i, char* s)
71797180
bool result;
71807181
char* expectedEnd = &s[strlen(s)];
71817182
char* end;
7182-
int b = strtoul(s, &end, 10);
7183-
if (end != expectedEnd) {
7183+
long b = strtoul(s, &end, 10);
7184+
if (end != expectedEnd || b > INT_MAX || b < INT_MIN) {
71847185
result = false;
71857186
} else {
7186-
i = b;
7187+
i = (int)b;
71877188
result = true;
71887189
}
71897190
return result;

0 commit comments

Comments
 (0)