You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Torsten Curdt (JIRA)" <ji...@apache.org> on 2009/01/07 15:00:45 UTC

[jira] Closed: (SANDBOX-74) [compress] TarInputStream returns negative value for read() [PATCH]

     [ https://issues.apache.org/jira/browse/SANDBOX-74?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Torsten Curdt closed SANDBOX-74.
--------------------------------

    Resolution: Fixed

> [compress] TarInputStream returns negative value for read() [PATCH]
> -------------------------------------------------------------------
>
>                 Key: SANDBOX-74
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-74
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Compress
>         Environment: Operating System: All
> Platform: All
>            Reporter: Adrian Pronk
>            Assignee: Torsten Curdt
>
> TarInputStream.read() does not convert the byte it has read to a positive number
> after casting it to an integer.  This causes downstream processes to fail to
> recognise the value properly.
> Index: org/apache/commons/compress/tar/TarInputStream.java
> ===================================================================
> --- org/apache/commons/compress/tar/TarInputStream.java	(revision 231420)
> +++ org/apache/commons/compress/tar/TarInputStream.java	(working copy)
> @@ -306,7 +306,7 @@
>          }
>          else
>          {
> -            return (int)m_oneBuf[ 0 ];
> +            return (int)m_oneBuf[ 0 ] & 0xFF;
>          }
>      }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.