Tue, 20 Feb 2007 00:18:18 +0100
Better handling of STRINGID_NONE
stringstore.c | file | annotate | diff | comparison | revisions |
--- a/stringstore.c Mon Jan 29 15:11:39 2007 +0100 +++ b/stringstore.c Tue Feb 20 00:18:18 2007 +0100 @@ -105,6 +105,9 @@ StringId stringstore_alloc(const char *str) { + if(str==NULL) + return STRINGID_NONE; + return stringstore_alloc_n(str, strlen(str)); } @@ -113,10 +116,8 @@ { Rb_node node=(Rb_node)id; - if(node==NULL){ - warn("Attempt to free un-allocated string from stringstore."); + if(node==NULL) return; - } if(node->v.ival<=0){ warn("Stringstore reference count corrupted.");