Skip to content

Commit

Permalink
Merge pull request #37 from katie-snow/ultistik_analog
Browse files Browse the repository at this point in the history
Fix convertULTISTIK return value when a value is invalid
  • Loading branch information
katie-snow authored Oct 27, 2016
2 parents db36edb + 3d35d3f commit b6414cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libs/ultistik.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ bool validateUltistikData(json_object* jobj)
bool valid = false;

char data;
const char invalidKey = 0x00;
const char invalidKey = 0xFF;

json_object* tmp = NULL;
json_object* key = NULL;
Expand All @@ -69,7 +69,7 @@ bool validateUltistikData(json_object* jobj)
{
key = json_object_array_get_idx(tmp, idx);
data = convertULTISTIK (key);
if (strcmp(&invalidKey, &data) == 0)
if (strcmp(&invalidKey, &data) == -1)
{
log_err ("Error at index %i in 'map' array, entry is '%s'", idx, json_object_get_string(key));
valid = false;
Expand Down Expand Up @@ -194,7 +194,7 @@ bool validateUltistikData(json_object* jobj)
char
convertULTISTIK (json_object *jobj)
{
char retval = 0x00;
char retval = 0xFF;
const char* str = json_object_get_string(jobj);

if (strlen(str) > 0)
Expand Down

0 comments on commit b6414cb

Please sign in to comment.