summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3d96322)
raw | patch | inline | side by side (parent: 3d96322)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 16 Aug 2010 08:32:27 +0000 (10:32 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 16 Aug 2010 08:32:27 +0000 (10:32 +0200) |
Due to the bit-wise check, the value for derive (0x30) matches the check
for gauge (0x10), too. This commit fixes the behavior by assigning other
numeric values to the defines.
for gauge (0x10), too. This commit fixes the behavior by assigning other
numeric values to the defines.
src/utils_match.c | patch | blob | history | |
src/utils_match.h | patch | blob | history |
diff --git a/src/utils_match.c b/src/utils_match.c
index bdbad3f213155a544b8d06009aa90c7322e7522c..9dd2da7db84a5d11b77adb3cdf1ff34727d99d51 100644 (file)
--- a/src/utils_match.c
+++ b/src/utils_match.c
if (matches_num < 2)
return (-1);
- value = strtoll (matches[1], &endptr, 0);
+ value = (derive_t) strtoll (matches[1], &endptr, 0);
if (matches[1] == endptr)
return (-1);
diff --git a/src/utils_match.h b/src/utils_match.h
index 5a0c0337fe6b14591a93ecfc256d61ecf81a26c5..e8f02a50491f05849c339613b6e3fc98e7736302 100644 (file)
--- a/src/utils_match.h
+++ b/src/utils_match.h
/*
* Defines
*/
-#define UTILS_MATCH_DS_TYPE_GAUGE 0x10
-#define UTILS_MATCH_DS_TYPE_COUNTER 0x20
-#define UTILS_MATCH_DS_TYPE_DERIVE 0x30
-#define UTILS_MATCH_DS_TYPE_ABSOLUTE 0x40
+#define UTILS_MATCH_DS_TYPE_GAUGE 0x10
+#define UTILS_MATCH_DS_TYPE_COUNTER 0x20
+#define UTILS_MATCH_DS_TYPE_DERIVE 0x40
+#define UTILS_MATCH_DS_TYPE_ABSOLUTE 0x80
#define UTILS_MATCH_CF_GAUGE_AVERAGE 0x01
#define UTILS_MATCH_CF_GAUGE_MIN 0x02