summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorgrant <grant>2005-11-18 03:31:11 +0000
committergrant <grant>2005-11-18 03:31:11 +0000
commitfca336c5194ac334aa35154d0d511d78cfcbb036 (patch)
treeaa66eb5aaca7f02a901bf63dc2123594c2c69538 /pkgtools
parent921f961d7793d91b790aba6ed9ef7554db38fc1d (diff)
downloadpkgsrc-fca336c5194ac334aa35154d0d511d78cfcbb036.tar.gz
pass const empty string to MAKEEXTRALIST macro instead of the
anonymous empty string. the macro uses the argument multiple times and the logic relies on identical strings having the same address, which is compiler dependent and not guaranteed to be the case. problem observed with pax(1) built with sunpro 11 on Solaris. from segv@netctl.net in PR pkg/32097.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/libnbcompat/files/vis.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/pkgtools/libnbcompat/files/vis.c b/pkgtools/libnbcompat/files/vis.c
index dd9cc1da1c1..a3427e04418 100644
--- a/pkgtools/libnbcompat/files/vis.c
+++ b/pkgtools/libnbcompat/files/vis.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vis.c,v 1.7 2004/08/23 03:32:13 jlam Exp $ */
+/* $NetBSD: vis.c,v 1.8 2005/11/18 03:31:11 grant Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -68,7 +68,7 @@
#include <nbcompat.h>
#include <nbcompat/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: vis.c,v 1.7 2004/08/23 03:32:13 jlam Exp $");
+__RCSID("$NetBSD: vis.c,v 1.8 2005/11/18 03:31:11 grant Exp $");
#endif /* LIBC_SCCS and not lint */
#if 0
@@ -329,10 +329,11 @@ vis(dst, c, flag, nextc)
{
char *extra;
+ const char *emptystr = "";
_DIAGASSERT(dst != NULL);
- MAKEEXTRALIST(flag, extra, "");
+ MAKEEXTRALIST(flag, extra, emptystr);
if (flag & VIS_HTTPSTYLE)
HVIS(dst, c, flag, nextc, extra);
else
@@ -359,8 +360,9 @@ strvis(dst, src, flag)
int flag;
{
char *extra;
+ const char *emptystr = "";
- MAKEEXTRALIST(flag, extra, "");
+ MAKEEXTRALIST(flag, extra, emptystr);
return (strsvis(dst, src, flag, extra));
}
@@ -373,7 +375,8 @@ strvisx(dst, src, len, flag)
int flag;
{
char *extra;
+ const char *emptystr = "";
- MAKEEXTRALIST(flag, extra, "");
+ MAKEEXTRALIST(flag, extra, emptystr);
return (strsvisx(dst, src, len, flag, extra));
}