- Timestamp:
- May 20, 2011, 3:59:31 PM (13 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- 351c535
- Parents:
- 3b8a563
- git-author:
- David Benjamin <davidben@mit.edu> (05/07/11 15:17:37)
- git-committer:
- David Benjamin <davidben@mit.edu> (05/20/11 15:59:31)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dict.c
rf25df21 rfda61d3 62 62 int owl_dict_get_keys(const owl_dict *d, owl_list *l) { 63 63 int i; 64 char *dupk;65 64 for (i=0; i<d->size; i++) { 66 if ((dupk = g_strdup(d->els[i].k)) == NULL) return(-1); 67 owl_list_append_element(l, dupk); 65 owl_list_append_element(l, g_strdup(d->els[i].k)); 68 66 } 69 67 return(0); … … 84 82 { 85 83 int pos, found; 86 char *dupk;87 84 found = _owl_dict_find_pos(d, k, &pos); 88 85 if (found && delete_on_replace) { … … 99 96 if (d->els==NULL) return(-1); 100 97 } 101 if ((dupk = g_strdup(k)) == NULL) return(-1);102 98 if (pos!=d->size) { 103 99 /* shift forward to leave us a slot */ … … 106 102 } 107 103 d->size++; 108 d->els[pos].k = dupk;104 d->els[pos].k = g_strdup(k); 109 105 d->els[pos].v = v; 110 106 return(0);
Note: See TracChangeset
for help on using the changeset viewer.