Code

write_graphite plugin: Print the time as an unsigned int.
authorFlorian Forster <octo@collectd.org>
Thu, 9 Feb 2012 09:46:21 +0000 (10:46 +0100)
committerFlorian Forster <octo@collectd.org>
Thu, 9 Feb 2012 09:46:21 +0000 (10:46 +0100)
Change-Id: I61f4952c8debdf7c80c4e1e4647cf42ecf00f033

src/write_graphite.c

index 2d61cac094630c8fcf8e694870980678706c76ea..857258a6294a7b0b232aa79d06ae2523c50d284f 100644 (file)
@@ -439,10 +439,10 @@ static int wg_send_message (const char* key, const char* value,
     char message[1024];
 
     message_len = (size_t) ssnprintf (message, sizeof (message),
-            "%s %s %.0f\r\n",
+            "%s %s %u\r\n",
             key,
             value,
-            CDTIME_T_TO_DOUBLE(time));
+            (unsigned int) CDTIME_T_TO_TIME_T (time));
     if (message_len >= sizeof (message)) {
         ERROR ("write_graphite plugin: message buffer too small: "
                 "Need %zu bytes.", message_len + 1);