summaryrefslogtreecommitdiff
path: root/lib/POE/Filter/VNDBAPI.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-03-09 19:04:26 +0100
committerYorhel <git@yorhel.nl>2010-03-09 19:04:26 +0100
commit484c3c43c63096a8fb6c3fca09e2e6a0388b662c (patch)
treebb0fcb023e2f189fb4567ab832f14950845476fe /lib/POE/Filter/VNDBAPI.pm
parent482c3165062aa35c9b4d0d58c180a9a09209a563 (diff)
Multi::API: Got rid of perl warning on incorrect JSON::XS::decode_prefix()
substr outside of string at /www/vndb/lib/POE/Filter/VNDBAPI.pm line 124. I have no idea what input caused JSON::XS to return an invalid character offset... but oh well.
Diffstat (limited to 'lib/POE/Filter/VNDBAPI.pm')
-rw-r--r--lib/POE/Filter/VNDBAPI.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/POE/Filter/VNDBAPI.pm b/lib/POE/Filter/VNDBAPI.pm
index 816643d9..6608893b 100644
--- a/lib/POE/Filter/VNDBAPI.pm
+++ b/lib/POE/Filter/VNDBAPI.pm
@@ -121,7 +121,7 @@ sub get_one {
$err =~ s/,? at .+ line [0-9]+[\.\r\n ]*$//;
return _err "Invalid JSON value in filter expression: $err";
}
- $str = substr $str, $chars;
+ $str = $chars > length($str) ? substr $str, $chars : '';
push @ret, $value;
}