aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/charon/definitions.c4
-rw-r--r--Source/charon/definitions.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/Source/charon/definitions.c b/Source/charon/definitions.c
index a866cc525..4df86221b 100644
--- a/Source/charon/definitions.c
+++ b/Source/charon/definitions.c
@@ -28,13 +28,13 @@
char *mapping_find(mapping_t * maps, int value)
{
int i = 0;
- while (maps[i].value > MAPPING_END)
+ while (maps[i].value != MAPPING_END)
{
- i++;
if (maps[i].value == value)
{
return maps[i].string;
}
+ i++;
}
return "INVALID MAPPING";
}
diff --git a/Source/charon/definitions.h b/Source/charon/definitions.h
index 790899015..8fe3c1c4e 100644
--- a/Source/charon/definitions.h
+++ b/Source/charon/definitions.h
@@ -24,7 +24,7 @@
#define DEFINITIONS_H_
-#define MAPPING_END -1
+#define MAPPING_END (-1)
/**
* @brief mapping entry, where enum-to-string mappings are stored