From: James Turner Date: Mon, 23 Apr 2012 21:29:54 +0000 (+0100) Subject: Fix latent bug in Nasal hash cget / cset functions, where the embedded string length X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0c13fb7ae4012bdf9fc22087f15cc22848615a1a;p=simgear.git Fix latent bug in Nasal hash cget / cset functions, where the embedded string length was set to an incorrect marker value. --- diff --git a/simgear/nasal/hash.c b/simgear/nasal/hash.c index 1efe8fbc..bb7ce785 100644 --- a/simgear/nasal/hash.c +++ b/simgear/nasal/hash.c @@ -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);