Kill npw_asprintf

It's not used anywhere and glib provides g_strdup_printf anyway.
This commit is contained in:
David Benjamin 2011-05-13 16:49:52 -04:00
parent c9a15440ef
commit 272e74cbf9
2 changed files with 0 additions and 20 deletions

View File

@ -372,25 +372,6 @@ const char *npw_strerror(int error)
return "Unknown error";
}
char *npw_asprintf(const char *format, ...)
{
va_list args;
va_start(args, format);
int alen = vsnprintf(NULL, 0, format, args);
va_end(args);
char *str = malloc(alen+1);
if (str == NULL)
return NULL;
va_start(args, format);
int rlen = vsnprintf(str, alen+1, format, args);
va_end(args);
if (rlen != alen) {
free(str);
return NULL;
}
return str;
}
/* Return 1 + max value the system can allocate to a new fd */
static int get_open_max(void)
{

View File

@ -49,7 +49,6 @@ extern const char *string_of_NPWindowType(int type) attribute_hidden;
// Misc utility functions
extern void npw_perror(const char *prefix, int error) attribute_hidden;
extern const char *npw_strerror(int error) attribute_hidden;
extern G_GNUC_PRINTF(1, 2) char *npw_asprintf(const char *format, ...) attribute_hidden;
extern void npw_close_all_open_files(void) attribute_hidden;
#ifdef __cplusplus