perl: added argument check

This commit is contained in:
Tokuhiro Matsuno
2009-04-15 23:11:26 +09:00
parent e0bd2a2911
commit b140b27b9a
2 changed files with 27 additions and 5 deletions

View File

@@ -136,7 +136,9 @@ static void _msgpack_pack_sv(enc_t *enc, SV* val) {
XS(xs_pack) {
dXSARGS;
PERL_UNUSED_VAR(items); /* TODO: check argument count */
if (items != 2) {
Perl_croak(aTHX_ "Usage: Data::MessagePack->pack($dat)");
}
SV* val = ST(1);