annotate lib/asnprintf.c @ 276:23034db7dd8a 2.5

fixed expression 'slots' to not store null on a pass 1 store
author lost
date Mon, 31 Aug 2009 08:39:36 +0000
parents d5392bb5da3c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
272
d5392bb5da3c Added generated files
lost
parents:
diff changeset
1 /* Formatted output to strings.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
2 Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
3
d5392bb5da3c Added generated files
lost
parents:
diff changeset
4 This program is free software; you can redistribute it and/or modify
d5392bb5da3c Added generated files
lost
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
d5392bb5da3c Added generated files
lost
parents:
diff changeset
6 the Free Software Foundation; either version 3, or (at your option)
d5392bb5da3c Added generated files
lost
parents:
diff changeset
7 any later version.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
8
d5392bb5da3c Added generated files
lost
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
d5392bb5da3c Added generated files
lost
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
d5392bb5da3c Added generated files
lost
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d5392bb5da3c Added generated files
lost
parents:
diff changeset
12 GNU General Public License for more details.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
13
d5392bb5da3c Added generated files
lost
parents:
diff changeset
14 You should have received a copy of the GNU General Public License along
d5392bb5da3c Added generated files
lost
parents:
diff changeset
15 with this program; if not, write to the Free Software Foundation,
d5392bb5da3c Added generated files
lost
parents:
diff changeset
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
17
d5392bb5da3c Added generated files
lost
parents:
diff changeset
18 #include <config.h>
d5392bb5da3c Added generated files
lost
parents:
diff changeset
19
d5392bb5da3c Added generated files
lost
parents:
diff changeset
20 /* Specification. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
21 #include "vasnprintf.h"
d5392bb5da3c Added generated files
lost
parents:
diff changeset
22
d5392bb5da3c Added generated files
lost
parents:
diff changeset
23 #include <stdarg.h>
d5392bb5da3c Added generated files
lost
parents:
diff changeset
24
d5392bb5da3c Added generated files
lost
parents:
diff changeset
25 char *
d5392bb5da3c Added generated files
lost
parents:
diff changeset
26 asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
d5392bb5da3c Added generated files
lost
parents:
diff changeset
27 {
d5392bb5da3c Added generated files
lost
parents:
diff changeset
28 va_list args;
d5392bb5da3c Added generated files
lost
parents:
diff changeset
29 char *result;
d5392bb5da3c Added generated files
lost
parents:
diff changeset
30
d5392bb5da3c Added generated files
lost
parents:
diff changeset
31 va_start (args, format);
d5392bb5da3c Added generated files
lost
parents:
diff changeset
32 result = vasnprintf (resultbuf, lengthp, format, args);
d5392bb5da3c Added generated files
lost
parents:
diff changeset
33 va_end (args);
d5392bb5da3c Added generated files
lost
parents:
diff changeset
34 return result;
d5392bb5da3c Added generated files
lost
parents:
diff changeset
35 }