add \0 in dumper would be better

This commit is contained in:
Cloud Wu
2017-08-22 09:41:24 +08:00
parent e48e6c40e7
commit fa763181c0
2 changed files with 3 additions and 2 deletions

View File

@@ -12,7 +12,7 @@ local address
local unique_id = 0 local unique_id = 0
local function unique_string(str) local function unique_string(str)
unique_id = unique_id + 1 unique_id = unique_id + 1
return str .. ("\0" .. tostring(unique_id)) return str .. tostring(unique_id)
end end
local function monitor(pointer) local function monitor(pointer)

View File

@@ -124,7 +124,8 @@ function ctd.dump(root)
string.pack("<I4", doc.table_n), string.pack("<I4", doc.table_n),
table.concat(index), table.concat(index),
table.concat(doc.table), table.concat(doc.table),
table.concat(doc.strings, "\0") table.concat(doc.strings, "\0"),
"\0",
} }
return table.concat(tmp) return table.concat(tmp)
end end