From 6f00795de8623347580c4366cb517a6653f73ca4 Mon Sep 17 00:00:00 2001
From: Liu Yiding <liuyd.fnst@fujitsu.com>
Date: Mon, 9 Jun 2025 08:01:39 +0000
Subject: [PATCH] fix too many arguments issue

fix issue like:
| procmail.c:76:12: error: too many arguments to function 'auth_finduid'; expected 0, have 2
|    76 |   if(tpass=auth_finduid(uid,0))                           /* save by copying */
|       |            ^~~~~~~~~~~~ ~~~
| In file included from procmail.c:36:
| authenticate.h:15:3: note: declared here
|    15 |  *auth_finduid Q((const uid_t uid,const int sock));
| --
| procmail.c:212:9: error: too many arguments to function 'checkprivFrom_'; expected 0, have 3
|   212 |         checkprivFrom_(euid,passinvk?auth_username(passinvk):0,override);
|       |         ^~~~~~~~~~~~~~ ~~~~
| In file included from procmail.c:41:
| from.h:9:2: note: declared here
|     9 |  checkprivFrom_ Q((uid_t euid,const char*logname,int override));
| --
| procmail.c:213:9: error: too many arguments to function 'doumask'; expected 0, have 1
|   213 |         doumask(INIT_UMASK);               /* allowed to set the From_ line? */
|       |         ^~~~~~~
| In file included from procmail.c:23:
| robust.h:12:2: note: declared here
|    12 |  doumask Q((const mode_t mask));

Upstream-Status: Submitted [https://github.com/BuGlessRB/procmail/pull/11]
Signed-off-by: Liu Yiding <liuyd.fnst@fujitsu.com>
---
 src/authenticate.h | 2 +-
 src/exopen.c       | 2 +-
 src/includes.h     | 2 +-
 src/misc.h         | 1 +
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/authenticate.h b/src/authenticate.h
index be9d88d..31e665a 100644
--- a/src/authenticate.h
+++ b/src/authenticate.h
@@ -7,7 +7,7 @@ typedef struct auth_identity auth_identity;
 
 #ifndef P
 #define P(x)	x
-#define Q(x)	()
+#define Q(x)	x
 #endif
 
 /*const*/auth_identity
diff --git a/src/exopen.c b/src/exopen.c
index c7647e5..46e3467 100644
--- a/src/exopen.c
+++ b/src/exopen.c
@@ -51,7 +51,7 @@ static const char*safehost P((void)) /* return a hostname safe for filenames */
   return sname;
 }
 
-int unique(full,p,len,mode,verbos,flags)char*const full;char*p;
+int unique(full,p,len,mode,verbos,flags)const char*const full;char*p;
  const size_t len;const mode_t mode;const int verbos,flags;
 { static const char s2c[]=".,+%";static int serial=STRLEN(s2c);
   static time_t t;char*dot,*end,*host;struct stat filebuf;
diff --git a/src/includes.h b/src/includes.h
index 7d6b41f..134805b 100644
--- a/src/includes.h
+++ b/src/includes.h
@@ -530,7 +530,7 @@ extern void*memmove();
  * problems caused by one of those types being shorter than int and thereby
  * being passed differently under ANSI rules.
  */
-#define Q(args)		()
+#define Q(args)		args
 
 #ifdef oBRAIN_DAMAGE
 #undef oBRAIN_DAMAGE
diff --git a/src/misc.h b/src/misc.h
index 4f62ebc..659dfcb 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -1,4 +1,5 @@
 /*$Id: misc.h,v 1.56 2001/06/30 01:14:19 guenther Exp $*/
+#include "authenticate.h"
 
 struct dyna_array{int filled,tspace;char*vals;};
 union offori{off_t o;int i;};
-- 
2.43.0

