X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ion3.git;a=blobdiff_plain;f=libtu%2Fstringstore.c;h=e47c902050a0051b23fc574aa6e83e8d024043e4;hp=5529820666cd46d27f7d25b01d9ce35070ca54dd;hb=20070318;hpb=803afbc1cd633f6c025bcd9537e9b7e9aedadd0d diff --git a/libtu/stringstore.c b/libtu/stringstore.c index 5529820..e47c902 100644 --- a/libtu/stringstore.c +++ b/libtu/stringstore.c @@ -105,6 +105,9 @@ StringId stringstore_alloc_n(const char *str, uint l) StringId stringstore_alloc(const char *str) { + if(str==NULL) + return STRINGID_NONE; + return stringstore_alloc_n(str, strlen(str)); } @@ -113,10 +116,8 @@ void stringstore_free(StringId id) { 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.");