diff options
| author | ruki <[email protected]> | 2021-08-05 00:35:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-08-05 00:35:38 +0800 |
| commit | 376aaf2b9432b2da255c4aaabcbc8c84d2372c4c (patch) | |
| tree | dfc6c82445dd54b18e0f664892af72001c7c5cc6 /xmake/modules/private/utils/bin2c.lua | |
| parent | b700ce5f896f1a3edfadafb4c188d1f147ea4ac7 (diff) | |
improve bin2c rule
Diffstat (limited to 'xmake/modules/private/utils/bin2c.lua')
| -rw-r--r-- | xmake/modules/private/utils/bin2c.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xmake/modules/private/utils/bin2c.lua b/xmake/modules/private/utils/bin2c.lua index c6022eba0..91ea1eafe 100644 --- a/xmake/modules/private/utils/bin2c.lua +++ b/xmake/modules/private/utils/bin2c.lua @@ -81,9 +81,10 @@ function _do_bin2c(binarypath, outputpath, opt) print("generating code data file from %s ..", binarypath) -- do dump - local binarydata = bytes(io.readfile(binarypath)) + local binarydata = bytes(io.readfile(binarypath, {encoding = "binary"})) local outputfile = io.open(outputpath, 'w') if outputfile then + binarydata = binarydata .. bytes('\0') _do_dump(binarydata, outputfile, opt) outputfile:close() end |
