|
@@ -83,7 +83,7 @@ static int _GetDeviceAccess(const char *pszDev)
|
|
DIR *pd;
|
|
DIR *pd;
|
|
const char *pszRp;
|
|
const char *pszRp;
|
|
const struct dirent *pde, *pde2;
|
|
const struct dirent *pde, *pde2;
|
|
- char szDir[512], szPath[512], szRealPath[512];
|
|
|
|
|
|
+ char szDir[PATH_MAX], szPath[PATH_MAX], szRealPath[PATH_MAX];
|
|
|
|
|
|
if((pd = opendir("/proc")))
|
|
if((pd = opendir("/proc")))
|
|
{
|
|
{
|
|
@@ -92,7 +92,7 @@ static int _GetDeviceAccess(const char *pszDev)
|
|
if(pde->d_type == DT_DIR && isdigit(*pde->d_name))
|
|
if(pde->d_type == DT_DIR && isdigit(*pde->d_name))
|
|
{
|
|
{
|
|
DIR *pd2;
|
|
DIR *pd2;
|
|
- sprintf(szDir, "/proc/%s/fd", pde->d_name);
|
|
|
|
|
|
+ snprintf(szDir, sizeof(szDir), "/proc/%s/fd", pde->d_name);
|
|
|
|
|
|
if((pd2 = opendir(szDir)))
|
|
if((pd2 = opendir(szDir)))
|
|
{
|
|
{
|
|
@@ -100,7 +100,7 @@ static int _GetDeviceAccess(const char *pszDev)
|
|
{
|
|
{
|
|
if(pde2->d_type == DT_LNK)
|
|
if(pde2->d_type == DT_LNK)
|
|
{
|
|
{
|
|
- sprintf(szPath, "%s/%s", szDir, pde2->d_name);
|
|
|
|
|
|
+ snprintf(szPath, sizeof(szPath), "%s/%s", szDir, pde2->d_name);
|
|
|
|
|
|
if((pszRp = realpath(szPath, szRealPath)))
|
|
if((pszRp = realpath(szPath, szRealPath)))
|
|
{
|
|
{
|