[sane-devel] Last call for XSane patches

Mikhail Novosyolov m.novosyolov at rosalinux.ru
Mon Sep 16 01:37:00 BST 2019


08.09.2019 21:39, Ralph Little пишет:
> Hi,
> I should that if anyone would like me to look at any additional 
> distros, then please let me know within the next few days.
> This is just a call for existing downstream patches that are currently 
> in use.
>
> Cheers,
> Ralph
>
Hi,

I've found the following patches:

1) https://abf.io/import/xsane/blob/rosa2019.1/xsane-0.998-libpng.patch 
, the same is in FreeBSD, NetBSD. Fixes building with libpng >= 1.5
There are some other patches: https://abf.io/import/xsane (I think you 
already saw them in e.g. Fedora or maybe they are already in upstream)

2) patch-lib_getopt_c and patch-src_xsane_c from OpenBSD, the first ones 
seems to fix compiler warnings and the second one fixes "overlapping memcpy"
These patches are attached.

-------------- next part --------------
$OpenBSD: patch-src_xsane_c,v 1.4 2014/12/04 21:05:42 ajacoutot Exp $

overlapping memcpy

--- src/xsane.c.orig	Tue Nov 16 21:57:51 2010
+++ src/xsane.c	Thu Dec  4 13:54:42 2014
@@ -4892,7 +4892,7 @@ static void xsane_device_dialog(void)
  char buf[TEXTBUFSIZE];
  char windowname[TEXTBUFSIZE];
  char devicetext[TEXTBUFSIZE];
- char *textptr;
+ char *cp, *textptr;
  GtkWidget *xsane_window;
  GtkWidget *xsane_vbox_main;
  GtkWidget *xsane_vbox_standard;
@@ -4993,8 +4993,8 @@ static void xsane_device_dialog(void)
     textptr = devicetext + strlen(devicetext);
   }
 
-  snprintf(buf, sizeof(buf), ":%s", devname);
-  snprintf(buf, sizeof(buf), "/%s", (strrchr(buf, ':')+1));
+  cp = strrchr(devname, ':');
+  snprintf(buf, sizeof(buf), "/%s", cp ? cp + 1 : devname);
   sprintf(textptr, "%s", (strrchr(buf, '/')+1));
 
   xsane.device_text = strdup(devicetext);
-------------- next part --------------
$OpenBSD: patch-lib_getopt_c,v 1.1 2015/05/02 12:51:28 ajacoutot Exp $

warning: implicit declaration of function 'getpid'
warning: implicit declaration of function 'strlen'
warning: implicit declaration of function 'strcmp'
warning: implicit declaration of function 'strncmp'

--- lib/getopt.c.orig	Wed Mar  3 00:14:45 1999
+++ lib/getopt.c	Sat May  2 14:49:21 2015
@@ -30,6 +30,9 @@
 #include <config.h>
 #endif
 
+#include <string.h>
+#include <unistd.h>
+
 #if !defined (__STDC__) || !__STDC__
 /* This is a separate conditional since some stdc systems
    reject `defined (const)'.  */


More information about the sane-devel mailing list