Skip to content

Commit

Permalink
Workaround for strange ScalarLogical behaviour.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Oct 31, 2014
1 parent c80478d commit 0e929a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/validate.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SEXP R_validate(SEXP x) {
stat = yajl_complete_parse(hand);
}

SEXP output = ScalarLogical(!stat);
SEXP output = PROTECT(duplicate(ScalarLogical(!stat)));

//error message
if (stat != yajl_status_ok) {
Expand All @@ -34,5 +34,6 @@ SEXP R_validate(SEXP x) {

/* return boolean vec (0 means no errors, means is valid) */
yajl_free(hand);
UNPROTECT(1);
return output;
}

0 comments on commit 0e929a5

Please sign in to comment.