Exec plugin: Update copyright header.
[collectd.git] / src / common.c
index d284fb8..b9e41b1 100644 (file)
@@ -659,6 +659,7 @@ long long get_kstat_value (kstat_t *ksp, char *name)
 }
 #endif /* HAVE_LIBKSTAT */
 
+#ifndef HAVE_HTONLL
 unsigned long long ntohll (unsigned long long n)
 {
 #if BYTE_ORDER == BIG_ENDIAN
@@ -676,6 +677,7 @@ unsigned long long htonll (unsigned long long n)
        return (((unsigned long long) htonl (n)) << 32) + htonl (n >> 32);
 #endif
 } /* unsigned long long htonll */
+#endif /* HAVE_HTONLL */
 
 #if FP_LAYOUT_NEED_NOTHING
 /* Well, we need nothing.. */
@@ -889,7 +891,11 @@ int parse_values (char *buffer, value_list_t *vl, const data_set_t *ds)
                dummy = NULL;
 
                if (i >= vl->values_len)
+               {
+                       /* Make sure i is invalid. */
+                       i = vl->values_len + 1;
                        break;
+               }
 
                if (i == -1)
                {