--- rxvt-unicode/src/rxvtperl.xs 2021/07/24 11:58:27 1.253 +++ rxvt-unicode/src/rxvtperl.xs 2021/11/24 18:17:20 1.256 @@ -531,7 +531,7 @@ } bool -rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...) +rxvt_perl_interp::invoke (rxvt_term *term, int htype, ...) { if (!perl || !term->perl.self) return false; @@ -1147,7 +1147,7 @@ CODE: { if (!IN_RANGE_EXC (new_value, 0, RS_customCount)) - croak ("custom value out of range, must be 0..%d", RS_customCount - 1); + croak ("custom value out of range, must be 0..%lu", RS_customCount - 1); RETVAL = (rend & ~RS_customMask) | ((new_value << RS_customShift) & RS_customMask); @@ -1376,6 +1376,9 @@ rxvt_term::locale_encode (SV *str) CODE: { + if (!SvOK (str)) + XSRETURN_UNDEF; + wchar_t *wstr = sv2wcs (str); rxvt_push_locale (THIS->locale); @@ -1394,6 +1397,9 @@ rxvt_term::locale_decode (SV *octets) CODE: { + if (!SvOK (octets)) + XSRETURN_UNDEF; + STRLEN len; char *data = SvPVbyte (octets, len);