* easprintf() calls vasprintf() and exits with an error if vasprintf()
* returns -1 (out of memory).
*/
-void
+int
#ifdef __STDC__
easprintf(char **ret, const char *fmt, ...)
#else
(void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
exit(1);
}
+ return(len);
}
/*
* evasprintf() calls vasprintf() and exits with an error if vasprintf()
* returns -1 (out of memory).
*/
-void
+int
evasprintf(ret, format, args)
char **ret;
const char *format;
va_list args;
{
+ int len;
- if (vasprintf(ret, format, args) == -1) {
+ if ((len = vasprintf(ret, format, args)) == -1) {
(void) fprintf(stderr, "%s: cannot allocate memory!\n", Argv[0]);
exit(1);
}
+ return(len);
}