On arm, chars are by default unsigned so force sign extension.
authorChristos Zoulas <christos@zoulas.com>
Wed, 15 Oct 2014 12:39:21 +0000 (12:39 +0000)
committerChristos Zoulas <christos@zoulas.com>
Wed, 15 Oct 2014 12:39:21 +0000 (12:39 +0000)
http://git.php.net/?p=php-src.git;a=patch;h=e64da8c20df3ec28bd2417924b207b870e9ab99f

src/apprentice.c

index 7d8bd1e1cfd37fbddc55a2cb8a6125d86ee4b911..d2628956676bd5c85a152c4a351af34f6eab2d8c 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.216 2014/09/24 19:49:07 christos Exp $")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.217 2014/10/15 12:39:21 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -1373,7 +1373,7 @@ file_signextend(struct magic_set *ms, struct magic *m, uint64_t v)
                 * the sign extension must have happened.
                 */
                case FILE_BYTE:
-                       v = (char) v;
+                       v = (signed char) v;
                        break;
                case FILE_SHORT:
                case FILE_BESHORT: