cli: fix wrong db dump format

It was broken by 03ff2976ed that changed fixed
32-bit length encoding to VarBytes.
This commit is contained in:
Roman Khimov 2019-12-26 20:03:06 +03:00
parent 9145855d2c
commit 7aa7490fb2

View file

@ -193,7 +193,8 @@ func dumpDB(ctx *cli.Context) error {
buf := io.NewBufBinWriter() buf := io.NewBufBinWriter()
b.EncodeBinary(buf.BinWriter) b.EncodeBinary(buf.BinWriter)
bytes := buf.Bytes() bytes := buf.Bytes()
writer.WriteVarBytes(bytes) writer.WriteU32LE(uint32(len(bytes)))
writer.WriteBytes(bytes)
if writer.Err != nil { if writer.Err != nil {
return cli.NewExitError(err, 1) return cli.NewExitError(err, 1)
} }