summaryrefslogtreecommitdiff
path: root/indra/newview/llwearable.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2007-01-24 20:21:23 +0000
committerSteven Bennetts <steve@lindenlab.com>2007-01-24 20:21:23 +0000
commitad94bca0d273869d6358719f4dbd515a905acd26 (patch)
tree52ae9f056f3dd6a938434d45d5295aef87e77e0a /indra/newview/llwearable.cpp
parent787ac69d75dbbd8ad79c32a5de54603351523eae (diff)
merge -r 56696:57082 Branch_1-13-2
Diffstat (limited to 'indra/newview/llwearable.cpp')
-rw-r--r--indra/newview/llwearable.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp
index ebe3c69c5c..4fe8a4b98e 100644
--- a/indra/newview/llwearable.cpp
+++ b/indra/newview/llwearable.cpp
@@ -246,6 +246,9 @@ BOOL LLWearable::exportFile( FILE* file )
BOOL LLWearable::importFile( FILE* file )
{
+ // *NOTE: changing the type or size of this buffer will require
+ // changes in the fscanf() code below. You would be better off
+ // rewriting this to use streams and not require an open FILE.
char text_buffer[2048];
S32 fields_read = 0;
@@ -276,7 +279,7 @@ BOOL LLWearable::importFile( FILE* file )
else
{
ungetc( next_char, file );
- fields_read = fscanf( file, "%[^\n]", text_buffer );
+ fields_read = fscanf( file, "%2047[^\n]", text_buffer );
if( (1 != fields_read) || (fgetc( file ) != '\n') )
{
llwarns << "Bad Wearable asset: early end of file" << llendl;
@@ -296,7 +299,7 @@ BOOL LLWearable::importFile( FILE* file )
else
{
ungetc( next_char, file );
- fields_read = fscanf( file, "%[^\n]", text_buffer );
+ fields_read = fscanf( file, "%2047[^\n]", text_buffer );
if( (1 != fields_read) || (fgetc( file ) != '\n') )
{
llwarns << "Bad Wearable asset: early end of file" << llendl;
@@ -403,7 +406,7 @@ BOOL LLWearable::importFile( FILE* file )
for( i = 0; i < num_textures; i++ )
{
S32 te = 0;
- fields_read = fscanf( file, "%d %s\n", &te, text_buffer);
+ fields_read = fscanf( file, "%d %2047s\n", &te, text_buffer);
if( fields_read != 2 )
{
llwarns << "Bad Wearable asset: bad texture, #" << i << llendl;