diff options
author | grant <grant@pkgsrc.org> | 2005-11-18 03:31:11 +0000 |
---|---|---|
committer | grant <grant@pkgsrc.org> | 2005-11-18 03:31:11 +0000 |
commit | 6e2b4f07ecfc31f077537c33ce67f778dc323d06 (patch) | |
tree | aa66eb5aaca7f02a901bf63dc2123594c2c69538 /pkgtools/libnbcompat | |
parent | 8d9999d01cd1779a2f77b55f25bff3aad0b8b721 (diff) | |
download | pkgsrc-6e2b4f07ecfc31f077537c33ce67f778dc323d06.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/libnbcompat')
-rw-r--r-- | pkgtools/libnbcompat/files/vis.c | 13 |
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)); } |