[vchkpw] vpopmail.c qnprintf patch

2005-07-08 Thread Stoyan Marinov
Hi guys, I needed to customize the vpopmail table structure for my needs and because of this I needed a different order of the arguments in the MySQL queries. I tried to use the %2$s in a query and noticed I can't do that. That's why I've made this little patch to make possible use this style for

Re: [vchkpw] vpopmail.c qnprintf patch

2005-07-08 Thread Tom Collins
On Jul 8, 2005, at 9:49 AM, Stoyan Marinov wrote: I needed to customize the vpopmail table structure for my needs and because of this I needed a different order of the arguments in the MySQL queries. I tried to use the %2$s in a query and noticed I can't do that. That's why I've made this

Re: [vchkpw] vpopmail.c qnprintf patch

2005-07-08 Thread Stoyan Marinov
Tom, You can find more info about this on the printf man page (3). Shortly - you can reuse some of the variables passed or reorder them. %2$s means the second string variable. Stoyan On Fri, 2005-07-08 at 23:39, Tom Collins wrote: On Jul 8, 2005, at 9:49 AM, Stoyan Marinov wrote: I needed

Re: [vchkpw] vpopmail.c qnprintf patch

2005-07-08 Thread Tom Collins
OK, I see what you're talking about. It isn't part of the C99 standard and I haven't seen it in other code before. I am very hesitant to include your patch in the main vpopmail distribution though. I tried to make a very simple, reliable function for creating SQL queries, and I think the

Re: [vchkpw] vpopmail.c qnprintf patch

2005-07-08 Thread Stoyan Marinov
I think this won't slow down the function in any way - it will just add more flexibility for the queries without touching the original arguments order. I didn't found any other way to do this. Here are the queries: Original: #ifdef MANY_DOMAINS #ifdef CLEAR_PASS #define INSERT insert into %s \ (