commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dennis Lundberg (JIRA)" <j...@apache.org>
Subject [jira] Moved: (COMPRESS-23) [compress] TarInputStream returns negative value for read() [PATCH]
Date Mon, 23 Mar 2009 22:19:52 GMT

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

Dennis Lundberg moved SANDBOX-74 to COMPRESS-23:
------------------------------------------------

    Component/s:     (was: Compress)
            Key: COMPRESS-23  (was: SANDBOX-74)
        Project: Commons Compress  (was: Commons Sandbox)

> [compress] TarInputStream returns negative value for read() [PATCH]
> -------------------------------------------------------------------
>
>                 Key: COMPRESS-23
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-23
>             Project: Commons Compress
>          Issue Type: Bug
>         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.


Mime
View raw message