Adding element id validity checks

This commit is contained in:
Michael Tryby
2019-04-16 16:57:38 -04:00
parent ea8e0439e3
commit 22a7993c8c
9 changed files with 93 additions and 9 deletions

View File

@@ -36,11 +36,12 @@ int cstr_duplicate(char **dest, const char *source)
}
bool cstr_validate_id(const char *element_id)
bool cstr_isvalid(const char *element_id)
// Determines if invalid characters are present in an element id string
{
const char *invalid_chars = " \";";
// if invalid char is present a pointer to it is returned else NULL
if (strpbrk(element_id, invalid_chars))
return false;
else

View File

@@ -25,7 +25,7 @@ extern "C" {
int cstr_duplicate(char **dest, const char *source);
bool cstr_validate_id(const char *element_id);
bool cstr_isvalid(const char *element_id);
bool cstr_isnullterm(const char *source);