version 1.1, 2015/03/19 14:57:29 |
version 1.4, 2016/07/18 18:35:05 |
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
*/ |
*/ |
|
|
|
#if defined(__linux__) || defined(__MINT__) |
|
#define _GNU_SOURCE /* vasprintf() */ |
|
#endif |
|
|
#include <stdarg.h> |
#include <stdarg.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <string.h> |
#include <string.h> |
|
|
int |
static int testfunc(char **, const char *, ...); |
|
|
|
|
|
static int |
testfunc(char **ret, const char *format, ...) |
testfunc(char **ret, const char *format, ...) |
{ |
{ |
va_list ap; |
va_list ap; |
Line 29 testfunc(char **ret, const char *format, ...) |
|
Line 36 testfunc(char **ret, const char *format, ...) |
|
irc = vasprintf(ret, format, ap); |
irc = vasprintf(ret, format, ap); |
va_end(ap); |
va_end(ap); |
|
|
return(irc); |
return irc; |
} |
} |
|
|
int |
int |
|
|
char *ret; |
char *ret; |
|
|
if (testfunc(&ret, "%s.", "Text") != 5) |
if (testfunc(&ret, "%s.", "Text") != 5) |
return(1); |
return 1; |
if (strcmp(ret, "Text.")) |
if (strcmp(ret, "Text.")) |
return(2); |
return 2; |
return(0); |
return 0; |
} |
} |