/*
utils.c -- gathering of some stupid small functions
Copyright (C) 1999-2001 Ivo Timmermans <zarq@iname.com>
- 2000,2001 Guus Sliepen <guus@sliepen.warande.net>
+ 2000,2001 Guus Sliepen <guus@sliepen.eu.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <sys/types.h>
#include <ctype.h>
#include <string.h>
-#include <stdarg.h>
#include "config.h"
);
}
#endif
-
-#ifndef HAVE_ASPRINTF
-int asprintf(char **buf, const char *fmt, ...)
-{
- int status;
- va_list ap;
- int len;
-
- len = 4096;
- *buf = xmalloc(len);
-
- va_start(ap, fmt);
- status = vsnprintf (*buf, len, fmt, ap);
- va_end (ap);
-
- if(status >= 0)
- *buf = xrealloc(*buf, status);
-
- if(status > len-1)
- {
- len = status;
- va_start(ap, fmt);
- status = vsnprintf (*buf, len, fmt, ap);
- va_end (ap);
- }
-
- return status;
-}
-#endif