Skip to content

Commit 3c6d328

Browse files
committedSep 18, 2021
Fix 32-bit builds
1 parent 9597656 commit 3c6d328

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎src/main.d

+7-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ struct Settings
7878
DDH_T ddh;
7979
char[] result;
8080
string listPath;
81-
ulong bufferSize = DEFAULT_CHUNK_SIZE;
81+
size_t bufferSize = DEFAULT_CHUNK_SIZE;
8282
SpanMode spanMode;
8383
bool follow = true;
8484
bool textMode;
@@ -119,7 +119,12 @@ struct Settings
119119
ulong v = void;
120120
if (strtobin(&v, val))
121121
throw new GetOptException("Couldn't unformat buffer size");
122-
bufferSize = v;
122+
version (D_LP64) {}
123+
else {
124+
if (v >= uint.max)
125+
throw new GetOptException("Buffer size overflows");
126+
}
127+
bufferSize = cast(size_t)v;
123128
}
124129

125130
void setSpanMode(string opt)

0 commit comments

Comments
 (0)
Please sign in to comment.