Fixed buffer bug in HTTP::Body::OctetStream
[catagits/HTTP-Body.git] / lib / HTTP / Body / OctetStream.pm
index 3104bd4..05c3cd2 100644 (file)
@@ -8,7 +8,7 @@ use File::Temp 0.14;
 
 =head1 NAME
 
-HTTP::Body - HTTP Body OctetStream Parser
+HTTP::Body::OctetStream - HTTP Body OctetStream Parser
 
 =head1 SYNOPSIS
 
@@ -34,7 +34,7 @@ sub spin {
     }
 
     if ( my $length = length( $self->{buffer} ) ) {
-        $self->body->write( substr( $self->{buffer}, 0, $length ), $length );
+        $self->body->write( substr( $self->{buffer}, 0, $length, '' ), $length );
     }
 
     if ( $self->length == $self->content_length ) {