Why can't I use the function multiple times in a printf line ?

Example:

#include <stdio.h>
#include <string.h>
#include "rfc1738.h"

int
main(int argc, char *const argv[])
{
char *user1,*user2,*user3;
user2=strdup("0123456789ABCDEFG");
user1=strdup("abcd");
user3=strdup("abcdefghijklmnopqrst");
printf("User1: %s\n",rfc1738_escape(user1));
printf("User2: %s\n",rfc1738_escape(user2));
printf("User3: %s\n",rfc1738_escape(user3));
printf("All Users: %s|%s|%s\n",rfc1738_escape(user1),rfc1738_escape(user2),rfc1738_escape(user3));

}

gives (last line for All Users is wrong):

Output:
User1: abcd
User2: 0123456789ABCDEFG
User3: abcdefghijklmnopqrst
All Users: abcd|abcd|abcd


Thank you
Markus


Reply via email to