Skip to content

Commit fa76318

Browse files
committed
add \0 in dumper would be better
1 parent e48e6c4 commit fa76318

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lualib/skynet/datasheet/builder.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ local address
1212
local unique_id = 0
1313
local function unique_string(str)
1414
unique_id = unique_id + 1
15-
return str .. ("\0" .. tostring(unique_id))
15+
return str .. tostring(unique_id)
1616
end
1717

1818
local function monitor(pointer)

lualib/skynet/datasheet/dump.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ function ctd.dump(root)
124124
string.pack("<I4", doc.table_n),
125125
table.concat(index),
126126
table.concat(doc.table),
127-
table.concat(doc.strings, "\0")
127+
table.concat(doc.strings, "\0"),
128+
"\0",
128129
}
129130
return table.concat(tmp)
130131
end

0 commit comments

Comments
 (0)