summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorruki <[email protected]>2025-12-07 08:06:04 +0800
committerruki <[email protected]>2025-12-07 17:15:59 +0800
commit1c5bf925dc824a6032832c7c8b7461981f512edb (patch)
treeb4669d6e4d0596c8dbd072ddcda9bb1d90d3b6cf /core/src
parentbce2cef4a7832f9df5b9e41e8b1689a5490249b3 (diff)
fix some review tips
Diffstat (limited to 'core/src')
-rw-r--r--core/src/xmake/utils/bin2coff.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/src/xmake/utils/bin2coff.c b/core/src/xmake/utils/bin2coff.c
index d48d89e09..426aab089 100644
--- a/core/src/xmake/utils/bin2coff.c
+++ b/core/src/xmake/utils/bin2coff.c
@@ -145,7 +145,7 @@ static tb_bool_t xm_utils_bin2coff_dump(tb_stream_ref_t istream,
// get file size
tb_hong_t filesize = tb_stream_size(istream);
- if (filesize < 0) {
+ if (filesize < 0 || filesize > 0xffffffffU) {
return tb_false;
}
tb_uint32_t datasize = (tb_uint32_t)filesize;
@@ -304,13 +304,13 @@ static tb_bool_t xm_utils_bin2coff_dump(tb_stream_ref_t istream,
// write string table
tb_stream_bwrit(ostream, (tb_byte_t const *)&string_table_size, 4);
- if (tb_strlen(symbol_start) > 8) {
- xm_utils_bin2coff_write_string(ostream, symbol_start, 0);
+ if (start_len > 8) {
+ xm_utils_bin2coff_write_string(ostream, symbol_start, start_len);
tb_byte_t null = 0;
tb_stream_bwrit(ostream, &null, 1);
}
- if (tb_strlen(symbol_end) > 8) {
- xm_utils_bin2coff_write_string(ostream, symbol_end, 0);
+ if (end_len > 8) {
+ xm_utils_bin2coff_write_string(ostream, symbol_end, end_len);
tb_byte_t null = 0;
tb_stream_bwrit(ostream, &null, 1);
}