[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#655456: Corrupt filename created when saving from XSane scan viewer



Hello Matthew!

Thanks a lot for your patch! However, I'm afraid we can't apply the
patch in it's current state as it results in a FTBFS, i.e. the package
fails to build:

=====================================================================

make[2]: Entering directory '/tmp/buildd/xsane-0.999/src'
gcc -c -DHAVE_CONFIG_H -DLOCALEDIR=/usr/share/locale
-DSANELOCALEDIR=/usr/share/locale -I. -I. -I../include -I../include
-I/usr/local/include -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE 	  -DV_MAJOR=0
-DV_MINOR=999 -DSANE_V_MAJOR=1
-DPATH_XSANE_DOC_DIR=/usr/share/sane/xsane/doc
-DPATH_SANE_DATA_DIR=/usr/share/sane -g -O2 -fstack-protector
--param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall
-pthread -I/usr/include/gtk-2.0
-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/
-I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0
-I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm
-I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0
-I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz
-I/usr/include/pango-1.0 -I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2
-I/usr/include/gimp-2.0   xsane-back-gtk.c
xsane-back-gtk.c: In function 'xsane_back_gtk_filetype2_callback':
xsane-back-gtk.c:1137:3: error: 'else' without a previous 'if'
   else
   ^
=====================================================================

Looking at the source with your patch applied, the result for the above
compile error becomes obvious:

=====================================================================

    }
    snprintf(filename, sizeof(filename), "%s%s", chooser_filename,
new_filetype);
  }
  else
  {
    snprintf(filename, sizeof(filename), "%s", chooser_filename);
  }
  else
  {
    strncpy(filename, chooser_filename, sizeof(filename));
    filename[sizeof(filename) - 1] = '\0';
  }

=====================================================================

So, there are two consecutive else code blocks which can't work since
the logic flow will never reach the code block after the second 'else'.

Your patch needs to be revised.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913


Reply to: