Skip to content
Browse files

[rt #69243] use names for i_tags_addn() instead of ST(n) and handle m…

…agic

The code checked SvOK() without SvGETMAGIC()
  • Loading branch information...
1 parent 73d8042 commit b9e2571f45fe236eacc2249b4695e54e8e9a517a @tonycoz committed May 24, 2013
Showing with 5 additions and 3 deletions.
  1. +5 −3 Imager.xs
View
8 Imager.xs
@@ -3630,16 +3630,18 @@ i_img_to_drgb(im)
Imager::ImgRaw im
undef_int
-i_tags_addn(im, name, code, idata)
+i_tags_addn(im, name_sv, code, idata)
Imager::ImgRaw im
+ SV *name_sv
int code
int idata
PREINIT:
char *name;
STRLEN len;
CODE:
- if (SvOK(ST(1)))
- name = SvPV(ST(1), len);
+ SvGETMAGIC(name_sv);
+ if (SvOK(name_sv))
+ name = SvPV_nomg(name_sv, len);
else
name = NULL;
RETVAL = i_tags_addn(&im->tags, name, code, idata);

0 comments on commit b9e2571

Please sign in to comment.
Something went wrong with that request. Please try again.