From 9b4f54c826ffa4f94efa866068c9d6ecdfb4b424 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:44:48 -0500 Subject: Second Life viewer sources 1.13.2.15 --- linden/indra/newview/llwearable.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'linden/indra/newview/llwearable.cpp') diff --git a/linden/indra/newview/llwearable.cpp b/linden/indra/newview/llwearable.cpp index 62a1d20..310eae5 100644 --- a/linden/indra/newview/llwearable.cpp +++ b/linden/indra/newview/llwearable.cpp @@ -265,6 +265,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; @@ -295,7 +298,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; @@ -315,7 +318,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; @@ -422,7 +425,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; -- cgit v1.1