Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Actually obey the key_len argument in exception messages
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sun, 7 Aug 2005 18:54:41 +0000 (18:54 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sun, 7 Aug 2005 18:54:41 +0000 (18:54 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1624 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/xbt/dict_elm.c

index 6f9cc70..267cf35 100644 (file)
@@ -666,7 +666,7 @@ _xbt_dictelm_get_rec(s_xbt_dictelm_t *p_head,
     switch (match) {
 
     case 0: /* no child have a common prefix */
-      THROW1(not_found_error,0,"key '%s' not found",key);
+      THROW2(not_found_error,0,"key '%.*s' not found",key_len,key);
 
     case 1: /* A child have exactly this key => Got it */
       {
@@ -685,10 +685,10 @@ _xbt_dictelm_get_rec(s_xbt_dictelm_t *p_head,
       }
 
     case 3: /* The key is a prefix of the child => not found */
-      THROW1(not_found_error,0,"key %s not found",key);
+      THROW2(not_found_error,0,"key %.*s not found",key_len,key);
 
     case 4: /* A child share a common prefix with this key => not found */
-      THROW1(not_found_error,0,"key %s not found",key);
+      THROW2(not_found_error,0,"key %.*s not found",key_len,key);
 
     default:
       THROW_IMPOSSIBLE;
@@ -711,7 +711,7 @@ xbt_dictelm_get_ext(s_xbt_dictelm_t *p_head,
                    int              key_len) {
   /* there is no head, go to hell */
   if (!p_head)
-    THROW2(not_found_error,0,"Key '%*s' not found in dict",key_len,key);
+    THROW2(not_found_error,0,"Key '%.*s' not found in dict",key_len,key);
 
   return _xbt_dictelm_get_rec(p_head, key, key_len, 0);
 }
@@ -851,7 +851,7 @@ _xbt_dictelm_remove_rec(xbt_dictelm_t head,
     case 3: /* The key is a prefix of the child => not found */
     case 4: /* A child share a common prefix with this key => not found */
 
-      THROW2(not_found_error,0,"Unable to remove key '%*s': not found",key_len,key);
+      THROW2(not_found_error,0,"Unable to remove key '%.*s': not found",key_len,key);
 
     default:
       THROW_IMPOSSIBLE;