diff options
author | quou <quou@disroot.org> | 2024-12-27 18:52:48 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-12-27 18:52:48 +1100 |
commit | d920e5d62020d751ccaa3491cc66275ade749011 (patch) | |
tree | e806a95c598e255f9883de98cc350a3b9279d0ce /sc | |
parent | e8c93463b2ae5114f0c88e768e5625abac9d5a50 (diff) |
building and running on windows with visual studio
Diffstat (limited to 'sc')
-rw-r--r-- | sc/sc.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -62,10 +62,7 @@ bool rf(const char* n, char*& buf, size_t& size) { rewind(f); buf = new char[size + 1]; buf[size] = 0; - if (size != fread(buf, 1, size, f)) { - delete[] buf; - return false; - } + buf[fread(buf, 1, size, f)] = 0; return true; } @@ -708,6 +705,7 @@ int main(int argc, const char** argv) { Desc desc; if (argc < 3) { print_err("Usage: %s infile outfile.\n", argv[0]); + return 1; } if (!rf(argv[1], src, src_size)) { print_err("Failed to read %s\n", argv[1]); |