fixed macros and ucx_map_store_enc

Wed, 06 Feb 2013 14:31:44 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Wed, 06 Feb 2013 14:31:44 +0100
changeset 79
cf3757c60c8f
parent 78
af355652f271
child 80
0125e4089f88

fixed macros and ucx_map_store_enc

ucx/map.c file | annotate | diff | comparison | revisions
ucx/map.h file | annotate | diff | comparison | revisions
--- a/ucx/map.c	Wed Feb 06 12:55:56 2013 +0100
+++ b/ucx/map.c	Wed Feb 06 14:31:44 2013 +0100
@@ -364,7 +364,7 @@
 
     UCX_MAP_FOREACH(v, iter) {
         k = (char*) iter.cur->key.data;
-        key = sstr(k);
+        key = sstrn(k, iter.cur->key.len);
         if (encoder) {
             size_t encodedSize;
             void *encoded = encoder(v, encdata, &encodedSize);
--- a/ucx/map.h	Wed Feb 06 12:55:56 2013 +0100
+++ b/ucx/map.h	Wed Feb 06 14:31:44 2013 +0100
@@ -72,7 +72,7 @@
 #define ucx_map_cstr_put(m, s, d) \
     ucx_map_put(m, ucx_key((void*)s, strlen(s)), d)
 #define ucx_map_int_put(m, i, d) \
-    ucx_map_put(m, ucx_key((void*)&i, sizeof(d)), d)
+    ucx_map_put(m, ucx_key((void*)&i, sizeof(i)), d)
 
 #define ucx_map_sstr_get(m, s) \
     ucx_map_get(m, ucx_key(s.ptr, s.length))
@@ -86,7 +86,7 @@
 #define ucx_map_cstr_remove(m, s) \
     ucx_map_remove(m, ucx_key((void*)s, strlen(s)))
 #define ucx_map_int_remove(m, i) \
-    ucx_map_remove(m, ucx_key((void*)&i, sizeof(int)))
+    ucx_map_remove(m, ucx_key((void*)&i, sizeof(i)))
 
 UcxKey ucx_key(void *data, size_t len);
 

mercurial