]> git.mxchange.org Git - simgear.git/commitdiff
Fix latent bug in Nasal hash cget / cset functions, where the embedded string length
authorJames Turner <zakalawe@mac.com>
Mon, 23 Apr 2012 21:29:54 +0000 (22:29 +0100)
committerJames Turner <zakalawe@mac.com>
Mon, 23 Apr 2012 21:29:54 +0000 (22:29 +0100)
was set to an incorrect marker value.

simgear/nasal/hash.c

index 1efe8fbcee5e4c62ceaba083df54c6d3334ed958..bb7ce785748a4ede78ab963254f34469cc9b9582 100644 (file)
@@ -179,7 +179,8 @@ void naiGCMarkHash(naRef hash)
 static void tmpStr(naRef* out, struct naStr* str, const char* key)
 {
     str->type = T_STR;
-    str->hashcode = str->emblen = 0;
+    str->hashcode = 0;
+    str->emblen = -1;
     str->data.ref.ptr = (unsigned char*)key;
     str->data.ref.len = strlen(key);
     SETPTR(*out, str);