summaryrefslogtreecommitdiff
path: root/indra/newview/lllogchat.cpp
diff options
context:
space:
mode:
authorAaron Brashears <aaronb@lindenlab.com>2007-02-02 17:28:58 +0000
committerAaron Brashears <aaronb@lindenlab.com>2007-02-02 17:28:58 +0000
commit305c74d5163c5e344a675d39ca2394a9e45bd2c2 (patch)
tree42836c4a6010b2b015156024d3cfb6bf64a48ad6 /indra/newview/lllogchat.cpp
parent54d89549df38bb61881583a3eb8d3645c107d79f (diff)
Result of svn merge -r57264:57370 svn+ssh://svn/svn/linden/branches/adroit.r40-68 into release.
Diffstat (limited to 'indra/newview/lllogchat.cpp')
-rw-r--r--indra/newview/lllogchat.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp
index 32f0032b0b..2c26fede2d 100644
--- a/indra/newview/lllogchat.cpp
+++ b/indra/newview/lllogchat.cpp
@@ -24,7 +24,13 @@ LLString LLLogChat::makeLogFileName(LLString filename)
//static
void LLLogChat::saveHistory(LLString filename, LLString line)
{
- FILE *fp = LLFile::fopen(LLLogChat::makeLogFileName(filename).c_str(), "a");
+ if(!filename.size())
+ {
+ llinfos << "Filename is Empty!" << llendl;
+ return;
+ }
+
+ FILE* fp = LLFile::fopen(LLLogChat::makeLogFileName(filename).c_str(), "a"); /*Flawfinder: ignore*/
if (!fp)
{
llinfos << "Couldn't open chat history log!" << llendl;
@@ -39,14 +45,19 @@ void LLLogChat::saveHistory(LLString filename, LLString line)
void LLLogChat::loadHistory(LLString filename , void (*callback)(LLString,void*), void* userdata)
{
- FILE *fptr = LLFile::fopen(makeLogFileName(filename).c_str(), "r");
+ if(!filename.size())
+ {
+ llerrs << "Filename is Empty!" << llendl;
+ }
+
+ FILE* fptr = LLFile::fopen(makeLogFileName(filename).c_str(), "r"); /*Flawfinder: ignore*/
if (!fptr)
{
return; //No previous conversation with this name.
}
else
{
- char buffer[LOG_RECALL_SIZE];
+ char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/
char *bptr;
S32 len;
bool firstline=TRUE;
@@ -63,7 +74,7 @@ void LLLogChat::loadHistory(LLString filename , void (*callback)(LLString,void*)
while ( fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr) )
{
- len = strlen(buffer) - 1;
+ len = strlen(buffer) - 1; /*Flawfinder: ignore*/
for ( bptr = (buffer + len); (*bptr == '\n' || *bptr == '\r') && bptr>buffer; bptr--) *bptr='\0';
if (!firstline)