/[cvs]/eggdrop1.9/src/egglib/msprintf.c
ViewVC logotype

Contents of /eggdrop1.9/src/egglib/msprintf.c

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Sun Oct 28 13:30:35 2001 UTC (17 years, 11 months ago) by ite
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +0 -0 lines
File MIME type: text/x-chdr
FILE REMOVED
Renamed src/adns, src/compat, src/egglib to lib/adns, lib/compat, lib/egglib respectively.

1 #include <stdio.h>
2 #include <stdarg.h>
3
4 char *msprintf(char *format, ...)
5 {
6 char *output;
7 int n, len;
8 va_list args;
9
10 output = (char *)malloc(128);
11 len = 128;
12 while (1) {
13 va_start(args, format);
14 n = vsnprintf(output, len, format, args);
15 va_end(args);
16 if (n > -1 && n < len) return(output);
17 if (n > len) len = n+1;
18 else len *= 2;
19 output = (char *)realloc(output, len);
20 }
21 return(output);
22 }

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23