From Harald Welte:
[obnox/wireshark/wip.git] / epan / guid-utils.c
index ce1dc2291ad0aaa8c8bc6ea2f8cd9af10ae4f3e3..3e44f46a98e58f2cab5b981287678cf60c170c03 100644 (file)
@@ -71,7 +71,7 @@ ResolveWin32UUID(e_guid_t if_id, char *uuid_name, int uuid_name_max_len)
                if (RegQueryValueEx(hKey, NULL, NULL, NULL, (LPBYTE)reg_uuid_name, &uuid_max_size) == ERROR_SUCCESS && uuid_max_size <= MAX_PATH) {
                        g_snprintf(uuid_name, uuid_name_max_len, "%s", utf_16to8(reg_uuid_name));
                        RegCloseKey(hKey);
-                       return strlen(uuid_name);
+                       return (int) strlen(uuid_name);
                }
                RegCloseKey(hKey);
        }
@@ -118,7 +118,7 @@ guids_add_guid(e_guid_t *guid, const gchar *name)
 }
 
 
-/* retreive the registered name for this GUID */
+/* retrieve the registered name for this GUID */
 const gchar *
 guids_get_guid_name(e_guid_t *guid)
 {
@@ -188,22 +188,17 @@ const gchar *
 guids_resolve_guid_to_str(e_guid_t *guid)
 {
        const gchar *name;
-       gchar *namebuf;
 
        name=guids_get_guid_name(guid);
        if(name){
                return name;
        }
 
-
-       namebuf=ep_alloc(64);
-       g_snprintf(namebuf, 64, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+       return ep_strdup_printf("%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
                       guid->data1, guid->data2, guid->data3,
                       guid->data4[0], guid->data4[1],
                       guid->data4[2], guid->data4[3],
                       guid->data4[4], guid->data4[5],
                       guid->data4[6], guid->data4[7]);
-       return namebuf;
 }
 
-