diff options
Diffstat (limited to 'linden/indra/newview/llwearable.cpp')
-rw-r--r-- | linden/indra/newview/llwearable.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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 ) | |||
265 | 265 | ||
266 | BOOL LLWearable::importFile( FILE* file ) | 266 | BOOL LLWearable::importFile( FILE* file ) |
267 | { | 267 | { |
268 | // *NOTE: changing the type or size of this buffer will require | ||
269 | // changes in the fscanf() code below. You would be better off | ||
270 | // rewriting this to use streams and not require an open FILE. | ||
268 | char text_buffer[2048]; | 271 | char text_buffer[2048]; |
269 | S32 fields_read = 0; | 272 | S32 fields_read = 0; |
270 | 273 | ||
@@ -295,7 +298,7 @@ BOOL LLWearable::importFile( FILE* file ) | |||
295 | else | 298 | else |
296 | { | 299 | { |
297 | ungetc( next_char, file ); | 300 | ungetc( next_char, file ); |
298 | fields_read = fscanf( file, "%[^\n]", text_buffer ); | 301 | fields_read = fscanf( file, "%2047[^\n]", text_buffer ); |
299 | if( (1 != fields_read) || (fgetc( file ) != '\n') ) | 302 | if( (1 != fields_read) || (fgetc( file ) != '\n') ) |
300 | { | 303 | { |
301 | llwarns << "Bad Wearable asset: early end of file" << llendl; | 304 | llwarns << "Bad Wearable asset: early end of file" << llendl; |
@@ -315,7 +318,7 @@ BOOL LLWearable::importFile( FILE* file ) | |||
315 | else | 318 | else |
316 | { | 319 | { |
317 | ungetc( next_char, file ); | 320 | ungetc( next_char, file ); |
318 | fields_read = fscanf( file, "%[^\n]", text_buffer ); | 321 | fields_read = fscanf( file, "%2047[^\n]", text_buffer ); |
319 | if( (1 != fields_read) || (fgetc( file ) != '\n') ) | 322 | if( (1 != fields_read) || (fgetc( file ) != '\n') ) |
320 | { | 323 | { |
321 | llwarns << "Bad Wearable asset: early end of file" << llendl; | 324 | llwarns << "Bad Wearable asset: early end of file" << llendl; |
@@ -422,7 +425,7 @@ BOOL LLWearable::importFile( FILE* file ) | |||
422 | for( i = 0; i < num_textures; i++ ) | 425 | for( i = 0; i < num_textures; i++ ) |
423 | { | 426 | { |
424 | S32 te = 0; | 427 | S32 te = 0; |
425 | fields_read = fscanf( file, "%d %s\n", &te, text_buffer); | 428 | fields_read = fscanf( file, "%d %2047s\n", &te, text_buffer); |
426 | if( fields_read != 2 ) | 429 | if( fields_read != 2 ) |
427 | { | 430 | { |
428 | llwarns << "Bad Wearable asset: bad texture, #" << i << llendl; | 431 | llwarns << "Bad Wearable asset: bad texture, #" << i << llendl; |