When util-enum encounters an error around enum value it should log the error
rather than losing it to console with printf.
Bug #2268
#include <string.h>
#include "util-enum.h"
+#include "util-debug.h"
/**
* \brief Maps a string name to an enum value from the supplied table. Please
int result = -1;
if (enum_name == NULL || table == NULL) {
- printf("Invalid argument(s) passed into SCMapEnumNameToValue\n");
+ SCLogDebug("Invalid argument(s) passed into SCMapEnumNameToValue");
return -1;
}
const char * SCMapEnumValueToName(int enum_value, SCEnumCharMap *table)
{
if (table == NULL) {
- printf("Invalid argument(s) passed into SCMapEnumValueToName\n");
+ SCLogDebug("Invalid argument(s) passed into SCMapEnumValueToName");
return NULL;
}
}
}
- printf("A enum by the value %d doesn't exist in this table\n", enum_value);
+ SCLogDebug("A enum by the value %d doesn't exist in this table", enum_value);
return NULL;
}