[sane-devel] Fix for backend/epson.c

Aurelien Jarno lists at aurel32.net
Sun Dec 8 10:49:22 GMT 2002


Hi all,

H i have received a bug report via the Debian BTS.

In backend/epson.c, lines 823 and 905, there is the following code:

     const u_char * s = buf;

     for( k = 0; k < buf_size; k++) {
       DBG( 125, "buf[%u] %02x %c\n", k, s[k], isprint( s[k]) ? s[k] : '.');

The second argument passed to DBG, s[k], is a char, but the compiler is
tell to read an int. It seems to work in most case, but it mail fail on
some architectures.

The following patch should fix the problem.

Aurelien


Index: epson.c
===================================================================
RCS file: /cvsroot/external/sane/sane-backends/backend/epson.c,v
retrieving revision 1.34
diff -u -1 -b -p -r1.34 epson.c
--- epson.c     2002/12/07 12:00:15     1.34
+++ epson.c     2002/12/08 10:41:34
@@ -832,3 +832,3 @@ send(Epson_Scanner * s, void *buf, size_
                {
-                       DBG( 125, "buf[%u] %02x %c\n", k, s[ k],
+                       DBG( 125, "buf[%u] %02hhx %c\n", k, s[ k],
                                        isprint( s[ k]) ? s[ k] : '.');
@@ -904,3 +904,3 @@ receive(Epson_Scanner * s, void *buf, ss
                for( k = 0; k < n; k++) {
-                       DBG( 127, "buf[%u] %02x %c\n", k, s[ k], isprint( s[ k]) ? s[ k] : '.');
+                       DBG( 127, "buf[%u] %02hhx %c\n", k, s[ k], isprint( s[ k]) ? s[ k] : '.');
                }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/sane-devel/attachments/20021208/5c8144be/attachment.sig>


More information about the sane-devel mailing list