Package: gifsicle
Version: 1.86-1
Severity: minor
Tags: upstream patch

Dear Maintainer,

When showing comment containing non-ASCII characters, `gifsicle -I` shows incorrect escape code (\37777777764 instead of \364) on platforms with signed char (e.g. x86{,_64}).
Patches against 1.86 and 1.88 attached.

-- System Information:
Debian Release: 8.6
  APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable'), (100, 'proposed-updates')
Architecture: i386 (x86_64)
Foreign Architectures: amd64

Kernel: Linux 3.16.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R (charmap=KOI8-R)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages gifsicle depends on:
ii  libc6     2.19-18+deb8u4
ii  libice6   2:1.0.9-1+b1
ii  libsm6    2:1.2.2-1+b1
ii  libx11-6  2:1.6.2-3

gifsicle recommends no packages.

gifsicle suggests no packages.

-- no debconf information

Index: gifsicle-1.86/src/support.c
===================================================================
--- gifsicle-1.86.orig/src/support.c
+++ gifsicle-1.86/src/support.c
@@ -310,7 +310,7 @@ safe_puts(const char *s, uint32_t len, F
        case '\v': fputs("\\v", f); break;
        case '\\': fputs("\\\\", f); break;
        case 0:	  if (len > 1) fputs("\\000", f); break;
-       default:	  fprintf(f, "\\%03o", *s); break;
+       default:	  fprintf(f, "\\%03o", *s & 0xFF); break;
       }
     }
   if (last_safe != s) {

Index: gifsicle-1.88/src/support.c
===================================================================
--- gifsicle-1.88.orig/src/support.c
+++ gifsicle-1.88/src/support.c
@@ -311,7 +311,7 @@ safe_puts(const char *s, uint32_t len, F
        case '\v': fputs("\\v", f); break;
        case '\\': fputs("\\\\", f); break;
        case 0:    if (len > 1) fputs("\\000", f); break;
-       default:   fprintf(f, "\\%03o", *s); break;
+       default:   fprintf(f, "\\%03o", *s & 0xFF); break;
       }
     }
   if (last_safe != s) {

Reply via email to