]> git.decadent.org.uk Git - ion3.git/blobdiff - libtu/stringstore.c
[svn-upgrade] Integrating new upstream version, ion3 (20070318)
[ion3.git] / libtu / stringstore.c
index 5529820666cd46d27f7d25b01d9ce35070ca54dd..e47c902050a0051b23fc574aa6e83e8d024043e4 100644 (file)
@@ -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.");