--- lsb-appchk3-3.2.2.orig/Makefile
+++ lsb-appchk3-3.2.2/Makefile
@@ -1,5 +1,5 @@
 export BINDIR=/bin
-export MANDIR=/man
+export MANDIR=/share/man
 export INSTALL_ROOT=/usr/local
 
 all:
--- lsb-appchk3-3.2.2.orig/tests/misc/appchk/appchk.c
+++ lsb-appchk3-3.2.2/tests/misc/appchk/appchk.c
@@ -116,7 +116,7 @@
 
 /* Real CVS revision number so we can strings it from the binary if necessary */
 static const char *__attribute((unused)) appchk_revision =
-    "$Revision: 1.34 $";
+    "$Revision: 1.1.1.3 $";
 
 void
 usage(char *progname)
@@ -329,7 +329,7 @@
             }
             break;
         case 'o':
-            snprintf(output_filename, TMP_STRING_SIZE, optarg);
+            snprintf(output_filename, TMP_STRING_SIZE, "%s", optarg);
             break;
         case 'j':
             do_journal = 1;
@@ -341,7 +341,7 @@
             do_missing_symbol = 1;
             break;
         case 'l':
-            snprintf(list_filename, TMP_STRING_SIZE, optarg);
+            snprintf(list_filename, TMP_STRING_SIZE, "%s", optarg);
             break;
         default:
             usage(argv[0]);
--- lsb-appchk3-3.2.2.orig/tests/misc/appchk/makefile
+++ lsb-appchk3-3.2.2/tests/misc/appchk/makefile
@@ -18,9 +18,9 @@
 
 install:
 	install -d $(INSTALL_ROOT)/$(BINDIR)
-	install appchk $(INSTALL_ROOT)/$(BINDIR)/lsbappchk
+	install appchk $(INSTALL_ROOT)/$(BINDIR)/lsbappchk3
 	install -d $(INSTALL_ROOT)/$(MANDIR)/man1
-	install lsbappchk.1 $(INSTALL_ROOT)/$(MANDIR)/man1/lsbappchk.1
+	install lsbappchk.1 $(INSTALL_ROOT)/$(MANDIR)/man1/lsbappchk3.1
 
 test: appchk
 	./test_appchk
--- lsb-appchk3-3.2.2.orig/tests/misc/rpmchk/vals.c
+++ lsb-appchk3-3.2.2/tests/misc/rpmchk/vals.c
@@ -5,6 +5,7 @@
  *
  */
 #include "rpmchk.h"
+#include "stdlib.h"
 /*
  * This file contains some values which must match, and some places to
  * stick things which are discovered in one place, but used in another.
--- lsb-appchk3-3.2.2.orig/tests/misc/rpmchk/rpmchk.h
+++ lsb-appchk3-3.2.2/tests/misc/rpmchk/rpmchk.h
@@ -42,24 +42,20 @@
 
 #if __i386__
 #define RPMARCH	0x0001
-#endif
-#if __ia64__
+#elif __ia64__
 #define RPMARCH	0x0009
-#endif
-#if __powerpc__ && !__powerpc64__
+#elif __powerpc__ && !__powerpc64__
 #define RPMARCH 0x0005
-#endif
-#if __powerpc64__
+#elif __powerpc64__
 #define RPMARCH 0x0010
-#endif
-#if __s390__ && !__s390x__
+#elif __s390__ && !__s390x__
 #define RPMARCH 0x000E
-#endif
-#if __s390x__
+#elif __s390x__
 #define RPMARCH 0x000F
-#endif
-#if __x86_64__
+#elif __x86_64__
 #define RPMARCH 0x0001
+#else
+#define RPMARCH 0x0000
 #endif
 
 #define RPMOS	0x0001 /* Linux */
