core-util: replace remaining fixed size destination string functions by _malloc() versions

This helps portability to GNU/Hurd.

Patch originally from Samuel Thibault but modified.

Closes ticket #546
This commit is contained in:
Lennart Poettering 2009-08-01 02:03:22 +02:00
parent c6ea9fecc9
commit 49fd8ee72e
7 changed files with 119 additions and 38 deletions

View file

@ -494,13 +494,14 @@ int pa_scache_add_directory_lazy(pa_core *c, const char *pathname) {
struct dirent *e;
while ((e = readdir(dir))) {
char p[PATH_MAX];
char *p;
if (e->d_name[0] == '.')
continue;
pa_snprintf(p, sizeof(p), "%s/%s", pathname, e->d_name);
p = pa_sprintf_malloc("%s" PA_PATH_SEP "%s", pathname, e->d_name);
add_file(c, p);
pa_xfree(p);
}
closedir(dir);