We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab9a324 commit 1d86bd8Copy full SHA for 1d86bd8
examples/gguf-split/gguf-split.cpp
@@ -59,10 +59,10 @@ static size_t split_str_to_n_bytes(std::string str) {
59
int n;
60
if (str.back() == 'M') {
61
sscanf(str.c_str(), "%d", &n);
62
- n_bytes = n * 1024 * 1024; // megabytes
+ n_bytes = (size_t)n * 1024 * 1024; // megabytes
63
} else if (str.back() == 'G') {
64
65
- n_bytes = n * 1024 * 1024 * 1024; // gigabytes
+ n_bytes = (size_t)n * 1024 * 1024 * 1024; // gigabytes
66
} else {
67
throw std::invalid_argument("error: supported units are M (megabytes) or G (gigabytes), but got: " + std::string(1, str.back()));
68
}
0 commit comments