Skip to content

Commit

Permalink
- tightened up "integer" type check (non-numbers fail, duh :^)
Browse files Browse the repository at this point in the history
  • Loading branch information
penduin committed Dec 20, 2012
1 parent a319177 commit 73fb3a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wjelement/schema.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ static XplBool ValidateType(WJElement value, char *type) {
return (value->type == WJR_TYPE_NUMBER);
} else if(!stricmp(type, "integer")) {
//return !WJRIntOrDouble(value, NULL, NULL);
return (WJEUInt64(value, NULL, WJE_GET, 0) ==
return (value->type == WJR_TYPE_NUMBER &&
WJEUInt64(value, NULL, WJE_GET, 0) ==
WJEDouble(value, NULL, WJE_GET, 1));
} else if(!stricmp(type, "boolean")) {
return (value->type == WJR_TYPE_BOOL ||
Expand Down

0 comments on commit 73fb3a7

Please sign in to comment.