Question about rfc1738_escape

From: Markus Moeller <huaraz_at_moeller.plus.com>
Date: Sun, 26 Aug 2012 19:28:16 +0100

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
Received on Sun Aug 26 2012 - 18:28:33 MDT

This archive was generated by hypermail 2.2.0 : Mon Aug 27 2012 - 12:00:11 MDT