ref: e159d02fe024d5bbf02b68209197ce58acd655e4
parent: b545c1eb75c29df1aef07babbaaa2cc749510630
author: Michael Forney <[email protected]>
date: Tue Feb 22 02:52:30 EST 2022
ream: use packlabel/packsnap in initsnap
--- a/ream.c
+++ b/ream.c
@@ -49,19 +49,17 @@
Kvp kv;
int i;
-
+ p = packlabel(kbuf, sizeof(kbuf), "main");
kv.k = kbuf;
+ kv.nk = p - kbuf;
+ p = packsnap(vbuf, sizeof(vbuf), 0);
kv.v = vbuf;
- kv.k[0] = Klabel;
- kv.nk = 1 + snprint(kv.k+1, sizeof(kbuf)-1, "main");
- kv.v[0] = Ksnap;
- PBIT64(kv.v+1, 0);
- kv.nv = Snapsz;
+ kv.nv = p - vbuf;
setval(s, &kv);
- kv.k[0] = Ksnap;
- PBIT64(kv.k+1, 0);
- kv.nk = Snapsz;
+ p = packsnap(kbuf, sizeof(kbuf), 0);
+ kv.k = kbuf;
+ kv.nk = p - kbuf;
memset(&t, 0, sizeof(Tree));
t.ref = 2;