--- sane-frontends-1.0.14/src/xscanimage.c.badcode 2005-11-21 15:29:15.000000000 +0100
+++ sane-frontends-1.0.14/src/xscanimage.c 2005-11-21 15:33:32.000000000 +0100
@@ -1284,7 +1284,7 @@
{ /* We are running in standalone mode */
/* test for pnm formats */
strncpy (testfilename, preferences.filename, sizeof (testfilename));
- testfilename[sizeof (testfilename)] = 0;
+ testfilename[sizeof (testfilename) - 1] = 0;
g_strreverse (testfilename);
if (!((!strncmp (testfilename, "mnp.", 4)) ||
(!strncmp (testfilename, "mgp.", 4)) ||
--- sane-frontends-1.0.14/src/xcam.c.badcode 2005-06-02 18:32:09.000000000 +0200
+++ sane-frontends-1.0.14/src/xcam.c 2005-11-21 15:32:42.000000000 +0100
@@ -1289,7 +1289,7 @@
/* test for pnm formats */
strncpy (testfilename, preferences.filename, sizeof (testfilename));
- testfilename[sizeof (testfilename)] = 0;
+ testfilename[sizeof (testfilename) - 1] = 0;
g_strreverse (testfilename);
if (!((!strncmp (testfilename, "mnp.", 4)) ||
(!strncmp (testfilename, "mgp.", 4)) ||