Skip to content

Commit

Permalink
Fix 32-bit builds
Browse files Browse the repository at this point in the history
  • Loading branch information
dd86k committed Sep 18, 2021
1 parent 9597656 commit 3c6d328
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct Settings
DDH_T ddh;
char[] result;
string listPath;
ulong bufferSize = DEFAULT_CHUNK_SIZE;
size_t bufferSize = DEFAULT_CHUNK_SIZE;
SpanMode spanMode;
bool follow = true;
bool textMode;
Expand Down Expand Up @@ -119,7 +119,12 @@ struct Settings
ulong v = void;
if (strtobin(&v, val))
throw new GetOptException("Couldn't unformat buffer size");
bufferSize = v;
version (D_LP64) {}
else {
if (v >= uint.max)
throw new GetOptException("Buffer size overflows");
}
bufferSize = cast(size_t)v;
}

void setSpanMode(string opt)
Expand Down

0 comments on commit 3c6d328

Please sign in to comment.