Fixed a gcc4 warning that pointed to really buggy code. Pointed out in

PR 36713.
This commit is contained in:
rillig 2007-07-31 19:22:10 +00:00
parent 5c68895846
commit 4bf0ca2a58
2 changed files with 22 additions and 1 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.9 2006/06/21 13:49:55 jlam Exp $
$NetBSD: distinfo,v 1.10 2007/07/31 19:22:10 rillig Exp $
SHA1 (LPRng-3.8.28.tgz) = f4373004adb1439819600701bb98517137daf1fc
RMD160 (LPRng-3.8.28.tgz) = f0460d7fa7d1ea0ce6b49fcb656905fdda3d0d41
@ -11,3 +11,4 @@ SHA1 (patch-ae) = 7abd651dc1433ea6069d35f201fb146703ce3eb2
SHA1 (patch-af) = 4a3f03207e3b1a94ebc5dd6375d40d3da8f8aedf
SHA1 (patch-ag) = bc84154636da3b331076b1051c1e70a9f65c858b
SHA1 (patch-ah) = 3c1b75ed1db210cd3d9033f59ecb43176b158a39
SHA1 (patch-ai) = 5b5f91911970f7033e22b67e0a5775102de9e313

View file

@ -0,0 +1,20 @@
$NetBSD: patch-ai,v 1.1 2007/07/31 19:22:10 rillig Exp $
PR: 36713
POSIX requires that each program gets at least argv[0]. This fixes the
following gcc4 warning:
./common/lpq.c:452: warning: not enough variable arguments to fit a sentinel
--- src/common/lpq.c.orig 2004-09-24 22:19:58.000000000 +0200
+++ src/common/lpq.c 2007-07-31 21:15:24.000000000 +0200
@@ -449,7 +449,7 @@ void Term_clear()
if( (pid = dofork(0)) == 0 ){
setuid( OriginalRUID );
close_on_exec(3);
- execl(CLEAR,0);
+ execl(CLEAR, CLEAR, (char *)0);
exit(1);
} else if( pid < 0 ){
LOGERR_DIE(LOG_ERR) _("fork() failed") );