mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 12:12:35 +03:00
make filepath_findfile() rely on realpath allocating the output buffer.
This commit is contained in:
parent
52c5cccdeb
commit
c3530a0c39
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user