LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File fix-uninitialized-variables.diff of Package sane-frontends (Project home:jsmeix)

# Fix uninitialized leftover variable 'fd'
# as in src/xcam.c from the CVS snapshot sane-frontends-2005-09-21.tar.gz
# see the mail on http://lists.alioth.debian.org/pipermail/sane-devel/2005-September/
# --------------------------------------------------------------------------------------
# From: Julien BLACHE <jb@jblache.org>
# Subject: Re: [sane-devel] sane-frontends 1.0.14 xcam.c using uninitialized variable
# ...
# Dead code. load_settings() opens filename and calls
# sanei_load_values().
# --------------------------------------------------------------------------------------
--- src/xcam.c.orig	2005-09-20 16:46:50.000000000 +0200
+++ src/xcam.c	2005-09-21 11:58:17.000000000 +0200
@@ -536,16 +536,14 @@
 load_defaults (int silent)
 {
   char filename[PATH_MAX];
-  int fd;
 
   DBG (DBG_debug, "xcam, load_defaults: enter\n");
   if (make_default_filename (sizeof (filename), filename, dialog->dev_name)
       < 0)
     return;
-  if (fd < 0)
-    return;
+
   load_settings (filename, silent);
-  sanei_load_values (fd, dialog->dev);
+
   DBG (DBG_debug, "xcam, load_defaults: exit\n");
 }