Fix some cppcheck warnings

Bug 77800 - cppcheck reports
diff --git a/src/hb-common.cc b/src/hb-common.cc
index 96725c4..afaecce 100644
--- a/src/hb-common.cc
+++ b/src/hb-common.cc
@@ -299,9 +299,11 @@
 
   if (len >= 0)
   {
+    /* NUL-terminate it. */
     len = MIN (len, (int) sizeof (strbuf) - 1);
-    str = (char *) memcpy (strbuf, str, len);
+    memcpy (strbuf, str, len);
     strbuf[len] = '\0';
+    str = strbuf;
   }
 
   hb_language_item_t *item = lang_find_or_insert (str);