return l;
}
-/* Return the total amonut used by a key (encoded length + payload) */
+/* Return the total amount used by a key (encoded length + payload) */
static unsigned int zipmapRawKeyLength(unsigned char *p) {
unsigned int l = zipmapDecodeLength(p);
return zipmapEncodeLength(NULL,l) + l;
}
-/* Return the total amonut used by a value
+/* Return the total amount used by a value
* (encoded length + single byte free count + payload) */
static unsigned int zipmapRawValueLength(unsigned char *p) {
unsigned int l = zipmapDecodeLength(p);
p += zipmapEncodeLength(NULL,l);
e = *p++;
fwrite(p,l,1,stdout);
- p += l;
+ p += l+e;
if (e) {
printf("[");
while(e--) printf(".");
zm = zipmapNew();
zm = zipmapSet(zm,(unsigned char*) "hello",5, (unsigned char*) "world!",6);
zm = zipmapSet(zm,(unsigned char*) "foo",3, (unsigned char*) "bar",3);
+ zm = zipmapSet(zm,(unsigned char*) "foo",3, (unsigned char*) "!",1);
zipmapRepr(zm);
return 0;
}