make filepath_findfile() rely on realpath allocating the output buffer.

This commit is contained in:
Vincent Sanders 2013-05-04 16:42:00 +01:00
parent 52c5cccdeb
commit c3530a0c39

View File

@ -89,21 +89,13 @@ char *filepath_sfindfile(char *str, const char *format, ...)
/* exported interface documented in filepath.h */
char *filepath_findfile(const char *format, ...)
{
char *str;
char *ret;
va_list ap;
str = malloc(PATH_MAX);
if (str == NULL)
return NULL; /* unable to allocate memory */
va_start(ap, format);
ret = filepath_vsfindfile(str, format, ap);
ret = filepath_vsfindfile(NULL, format, ap);
va_end(ap);
if (ret == NULL)
free(str);
return ret;
}