summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2016-08-09 18:11:49 +0200
committerDidier Raboud <odyx@debian.org>2018-03-27 19:15:03 +0200
commit0d662bff1316657843ba3f4e484e2bf55752f927 (patch)
tree7ca0dc015e2adb19ec17eea9cf435b5689d88031 /man
parentc6e00445b5ec8ca10944d82cd9d5ba4a8e1dd45e (diff)
Build mantohtml with the build architecture compiler
mantohtml is run during build. Thus it needs to be built with the build architecture compiler (or execution fails). The obvious part is switching to CC_FOR_BUILD. That also depends on it not requiring any other cups components. In particular, removing uses of strlcpy and replacing host architecture- specific includes is thus needed. Bug-Debian: https://bugs.debian.org/837936
Diffstat (limited to 'man')
-rw-r--r--man/Makefile6
-rw-r--r--man/mantohtml.c15
2 files changed, 12 insertions, 9 deletions
diff --git a/man/Makefile b/man/Makefile
index 4b10dffc5..3c3270ade 100644
--- a/man/Makefile
+++ b/man/Makefile
@@ -226,7 +226,5 @@ html: $(MAN1) $(MAN5) $(MAN7) $(MAN8) mantohtml
./mantohtml `basename $$file .$(MAN8EXT)`.man >../doc/help/man-`basename $$file .$(MAN8EXT)`.html; \
done
-mantohtml: mantohtml.o ../cups/$(LIBCUPSSTATIC)
- $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ mantohtml.o \
- ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) \
- $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+mantohtml: mantohtml.c
+ $(CC_FOR_BUILD) -o $@ $<
diff --git a/man/mantohtml.c b/man/mantohtml.c
index bf7ba5fe8..80acf5512 100644
--- a/man/mantohtml.c
+++ b/man/mantohtml.c
@@ -15,8 +15,10 @@
* Include necessary headers.
*/
-#include <cups/string-private.h>
-#include <cups/array-private.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
@@ -815,7 +817,8 @@ main(int argc, /* I - Number of command-line args */
* Anchor for HTML output...
*/
- strlcpy(anchor, line + 4, sizeof(anchor));
+ strncpy(anchor, line + 4, sizeof(anchor) - 1);
+ anchor[sizeof(anchor) - 1] = '\0';
}
else if (strncmp(line, ".\\\"", 3))
{
@@ -944,7 +947,8 @@ html_alternate(const char *s, /* I - String */
manfile[1024], /* Man page filename */
manurl[1024]; /* Man page URL */
- strlcpy(name, s, sizeof(name));
+ strncpy(name, s, sizeof(name) - 1);
+ name[sizeof(name) - 1] = '\0';
if ((size_t)(end - s) < sizeof(name))
name[end - s] = '\0';
@@ -1177,7 +1181,8 @@ html_fputs(const char *s, /* I - String */
if (end[-1] == ',' || end[-1] == '.' || end[-1] == ')')
end --;
- strlcpy(temp, s, sizeof(temp));
+ strncpy(temp, s, sizeof(temp) - 1);
+ temp[sizeof(temp) - 1] = '\0';
if ((size_t)(end -s) < sizeof(temp))
temp[end - s] = '\0';