title: GLib: Hashtable not finding values correctly
body: <p>So I've been recently using GLib's types, such as lists and maps, but I've encountered a rather troublesome issue.</p>
  
  <p>Starting off, I created my hashtable as such: </p>
  
  <pre><code>BoneIdMap = g_hash_table_new(g_direct_hash, g_str_equal);
  </code></pre>
  
  <p>I then try it out, insert some uint at a string key, and it works perfectly:</p>
  
  <pre><code>char* string = alloq_calloc(&amp;model-&gt;dynamic, strlen(aimesh-&gt;mBones[x]-&gt;mName.data) + 1, sizeof(char));
  strcpy(string, aimesh-&gt;mBones[x]-&gt;mName.
  if(map_find(&amp;model-&gt;BoneIdMap, string, &amp;handle)) {
      index = *handle;
  } else {
      index = model-&gt;BoneIdMap.size;
  }
  map_insert(&amp;model-&gt;BoneIdMap, &amp;index, sizeof(uint), string);
  </code></pre>
  
  <p>Take note: that I dynamically allocate the pointer, that's because I tried just passing the static array and it doesn't work (turns out both don't work)</p>
  
  <p>I then proceed to try and retrieve those uints later down the line:</p>
  
  <pre><code>char* string = alloq_calloc(&amp;model-&gt;dynamic, strlen(ainode-&gt;mName.data) + 1, sizeof(char));
  strcpy(string, ainode-&gt;mName.data);
  /* Time to do some debugging */
  if(map_find(&amp;model-&gt;BoneIdMap, string, &amp;handle)) {
  </code></pre>
  
  <p>But It simply doesn't work... I tried retrieving all the keys into an array:</p>
  
  <pre><code>uint len;
  char** arr = g_hash_table_get_keys_as_array(model-&gt;BoneIdMap.table, &amp;len);
  for(int i = 0; i &lt; len; ++i) {
     if(arr[i]) printf("Key: %s\n", arr[i]);
         if(!strcmp(arr[i], ainode-&gt;mName.data)) printf("Yes!\n");
  }
  printf("----------------------------\n");
  </code></pre>
  
  <p>And It works!!! (???)</p>
  
  <pre><code>Key: pelvis
  Key: toe.L
  Yes!
  Key: sheath
  Key: lamp
  ----------------------------
  Key: toe.R
  Key: shin.L
  Key: fingerstip.R
  Key: neck
  Key: thigh.R
  Key: fingers.L
  Key: shin.R
  Key: spine
  Key: lamp
  Key: head
  Key: fingerstip.L
  Key: thm_end.L
  Key: thm_end.R
  Key: tiptoe.L
  Yes!
  Key: upperarm.R
  </code></pre>
  
  <p>Take note that if I were to add a key using a static string right there besides the above printing function and try to find it, it would work!
  Which leaves me quite confused ...</p>
  
  <p>By the way, mName is an aiString (ASSIMP) --</p>
  
  <pre><code>Public Attributes
  char    data [MAXLEN]
      String buffer.
  size_t  length
      Binary length of the string excluding the terminal 0.
  </code></pre>
  
  <p>Thank you for reading...</p>