From 89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:44:50 -0500 Subject: Second Life viewer sources 1.14.0.0 --- linden/indra/llvfs/lldir_linux.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'linden/indra/llvfs/lldir_linux.cpp') diff --git a/linden/indra/llvfs/lldir_linux.cpp b/linden/indra/llvfs/lldir_linux.cpp index 780fbdb..f46ccf2 100644 --- a/linden/indra/llvfs/lldir_linux.cpp +++ b/linden/indra/llvfs/lldir_linux.cpp @@ -51,7 +51,7 @@ static std::string getCurrentUserHome(char* fallback) else { llinfos << "Couldn't detect home directory from passwd - trying $HOME" << llendl; - const char *const home_env = getenv("HOME"); + const char *const home_env = getenv("HOME"); /* Flawfinder: ignore */ if (home_env) { result_cstr = (char*) home_env; @@ -73,7 +73,7 @@ LLDir_Linux::LLDir_Linux() mCurrentDirCount = -1; mDirp = NULL; - char tmp_str[LL_MAX_PATH]; + char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */ getcwd(tmp_str, LL_MAX_PATH); mExecutableFilename = ""; @@ -85,13 +85,13 @@ LLDir_Linux::LLDir_Linux() mOSUserAppDir = ""; mLindenUserDir = tmp_str; - char path [32]; + char path [32]; /* Flawfinder: ignore */ // *NOTE: /proc/%d/exe doesn't work on FreeBSD. But that's ok, // because this is the linux implementation. - sprintf (path, "/proc/%d/exe", (int) getpid ()); - int rc = readlink (path, tmp_str, sizeof (tmp_str)-1); + snprintf (path, sizeof(path), "/proc/%d/exe", (int) getpid ()); /* Flawfinder: ignore */ + int rc = readlink (path, tmp_str, sizeof (tmp_str)-1); /* Flawfinder: ignore */ if ( (rc != -1) && (rc <= ((int) sizeof (tmp_str)-1)) ) { tmp_str[rc] = '\0'; //readlink() doesn't 0-terminate the buffer @@ -128,7 +128,7 @@ void LLDir_Linux::initAppDirs(const std::string &app_name) LLString upper_app_name(app_name); LLString::toUpper(upper_app_name); - char* app_home_env = getenv((upper_app_name + "_USER_DIR").c_str()); + char* app_home_env = getenv((upper_app_name + "_USER_DIR").c_str()); /* Flawfinder: ignore */ if (app_home_env) { // user has specified own userappdir i.e. $SECONDLIFE_USER_DIR @@ -326,7 +326,7 @@ void LLDir_Linux::getRandomFileInDir(const std::string &dirname, const std::stri std::string LLDir_Linux::getCurPath() { - char tmp_str[LL_MAX_PATH]; + char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */ getcwd(tmp_str, LL_MAX_PATH); return tmp_str; } -- cgit v1.1