Code

collectd-threshold(5): Correct the description of the "Interesting" config option.
[collectd.git] / src / uuid.c
index d54301a223bee899c430f4f1d19de617e8b78a4a..cf23f5b37eea4e6505f62cb8ac37c65def408a07 100644 (file)
@@ -55,7 +55,7 @@ looks_like_a_uuid (const char *uuid)
         return 0;
 
     while (*uuid) {
-        if (!isxdigit (*uuid) && *uuid != '-') return 0;
+        if (!isxdigit ((int)*uuid) && *uuid != '-') return 0;
         uuid++;
     }
     return 1;
@@ -257,8 +257,7 @@ uuid_init (void)
     char *uuid = uuid_get_local ();
 
     if (uuid) {
-        strncpy (hostname_g, uuid, DATA_MAX_NAME_LEN);
-        hostname_g[DATA_MAX_NAME_LEN-1] = '\0';
+        sstrncpy (hostname_g, uuid, DATA_MAX_NAME_LEN);
         sfree (uuid);
         return 0;
     }