diff --git a/monitor/uuid.c b/monitor/uuid.c
index 9839d03..bc638a2 100644
--- a/monitor/uuid.c
+++ b/monitor/uuid.c
#endif
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include "uuid.h"
const char *uuidstr_to_str(const char *uuid)
{
uint32_t val;
+ size_t len;
int i;
if (!uuid)
return NULL;
- if (strlen(uuid) != 36)
+ len = strlen(uuid);
+
+ if (len < 36) {
+ char *endptr = NULL;
+
+ val = strtol(uuid, &endptr, 0);
+ if (!endptr || *endptr != '\0')
+ return NULL;
+
+ if (val > UINT16_MAX)
+ return uuid32_to_str(val);
+
+ return uuid16_to_str(val);
+ }
+
+ if (len != 36)
return NULL;
for (i = 0; uuid128_table[i].str; i++) {