Skip to content

Commit

Permalink
Raw.xs: pass NULL to C function instead of "" with undef string (closes
Browse files Browse the repository at this point in the history
  • Loading branch information
ghedo committed Dec 18, 2013
1 parent 36fee36 commit 608cfaa
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Raw.xs
Expand Up @@ -314,8 +314,15 @@ call(self, ...)
case 'd': FFI_SET_ARG(double, SvNV)
case 's': {
STRLEN l;
char **val; Newx(val, 1, char *);
*val = SvPV(arg, l);
char **val;

Newx(val, 1, char *);

if (SvOK(arg))
*val = SvPV(arg, l);
else
*val = NULL;

values[i] = val;
break;
}
Expand Down

0 comments on commit 608cfaa

Please sign in to comment.