Skip to content
Snippets Groups Projects
Commit 9dd538ea authored by Stan Seibert's avatar Stan Seibert
Browse files

PATH_MAX is the more appropriate constant. Closes bug 238.

git-svn-id: http://svn.xiph.org/trunk/ao@5256 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent 745a04c2
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <limits.h>
#include <dlfcn.h> #include <dlfcn.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
...@@ -232,7 +233,7 @@ static void _append_dynamic_drivers(driver_list *end) ...@@ -232,7 +233,7 @@ static void _append_dynamic_drivers(driver_list *end)
struct dirent *plugin_dirent; struct dirent *plugin_dirent;
char *ext; char *ext;
struct stat statbuf; struct stat statbuf;
char fullpath[FILENAME_MAX]; char fullpath[PATH_MAX];
DIR *plugindir; DIR *plugindir;
driver_list *plugin; driver_list *plugin;
driver_list *driver = end; driver_list *driver = end;
...@@ -241,7 +242,7 @@ static void _append_dynamic_drivers(driver_list *end) ...@@ -241,7 +242,7 @@ static void _append_dynamic_drivers(driver_list *end)
plugindir = opendir(AO_PLUGIN_PATH); plugindir = opendir(AO_PLUGIN_PATH);
if (plugindir != NULL) { if (plugindir != NULL) {
while ((plugin_dirent = readdir(plugindir)) != NULL) { while ((plugin_dirent = readdir(plugindir)) != NULL) {
snprintf(fullpath, FILENAME_MAX, "%s/%s", snprintf(fullpath, PATH_MAX, "%s/%s",
AO_PLUGIN_PATH, plugin_dirent->d_name); AO_PLUGIN_PATH, plugin_dirent->d_name);
if (!stat(fullpath, &statbuf) && if (!stat(fullpath, &statbuf) &&
S_ISREG(statbuf.st_mode) && S_ISREG(statbuf.st_mode) &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment