aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/llcachename.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:48 -0500
committerJacek Antonelli2008-08-15 23:44:48 -0500
commit9b4f54c826ffa4f94efa866068c9d6ecdfb4b424 (patch)
tree2f8ae193ab487088962e628f1ee9dee2f5901f01 /linden/indra/llmessage/llcachename.cpp
parentSecond Life viewer sources 1.13.2.12 (diff)
downloadmeta-impy-9b4f54c826ffa4f94efa866068c9d6ecdfb4b424.zip
meta-impy-9b4f54c826ffa4f94efa866068c9d6ecdfb4b424.tar.gz
meta-impy-9b4f54c826ffa4f94efa866068c9d6ecdfb4b424.tar.bz2
meta-impy-9b4f54c826ffa4f94efa866068c9d6ecdfb4b424.tar.xz
Second Life viewer sources 1.13.2.15
Diffstat (limited to 'linden/indra/llmessage/llcachename.cpp')
-rw-r--r--linden/indra/llmessage/llcachename.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/linden/indra/llmessage/llcachename.cpp b/linden/indra/llmessage/llcachename.cpp
index 9995a6e..3a92812 100644
--- a/linden/indra/llmessage/llcachename.cpp
+++ b/linden/indra/llmessage/llcachename.cpp
@@ -284,6 +284,7 @@ void LLCacheName::importFile(FILE* fp)
284 const S32 BUFFER_SIZE = 1024; 284 const S32 BUFFER_SIZE = 1024;
285 char buffer[BUFFER_SIZE]; /*Flawfinder: ignore*/ 285 char buffer[BUFFER_SIZE]; /*Flawfinder: ignore*/
286 286
287 // *NOTE: These buffer sizes are hardcoded into sscanf() below
287 char id_string[MAX_STRING]; /*Flawfinder: ignore*/ 288 char id_string[MAX_STRING]; /*Flawfinder: ignore*/
288 char firstname[MAX_STRING]; /*Flawfinder: ignore*/ 289 char firstname[MAX_STRING]; /*Flawfinder: ignore*/
289 char lastname[MAX_STRING]; /*Flawfinder: ignore*/ 290 char lastname[MAX_STRING]; /*Flawfinder: ignore*/
@@ -293,9 +294,10 @@ void LLCacheName::importFile(FILE* fp)
293 char* valid = fgets(buffer, BUFFER_SIZE, fp); 294 char* valid = fgets(buffer, BUFFER_SIZE, fp);
294 if (!valid) return; 295 if (!valid) return;
295 296
297 // *NOTE: This buffer size is hardcoded into sscanf() below
296 char version_string[BUFFER_SIZE]; /*Flawfinder: ignore*/ 298 char version_string[BUFFER_SIZE]; /*Flawfinder: ignore*/
297 S32 version = 0; 299 S32 version = 0;
298 S32 match = sscanf(buffer, "%s %d", version_string, &version); // XXXTBD 300 S32 match = sscanf(buffer, "%1023s %d", version_string, &version);
299 if ( match != 2 301 if ( match != 2
300 || strcmp(version_string, "version") 302 || strcmp(version_string, "version")
301 || version != CN_FILE_VERSION) 303 || version != CN_FILE_VERSION)
@@ -314,11 +316,13 @@ void LLCacheName::importFile(FILE* fp)
314 valid = fgets(buffer, BUFFER_SIZE, fp); 316 valid = fgets(buffer, BUFFER_SIZE, fp);
315 if (!valid) break; 317 if (!valid) break;
316 318
317 match = sscanf(buffer, "%s %u %s %s", // XXXTBD 319 match = sscanf(
318 id_string, 320 buffer,
319 &create_time, 321 "%254s %u %254s %254s",
320 firstname, 322 id_string,
321 lastname); 323 &create_time,
324 firstname,
325 lastname);
322 if (4 != match) continue; 326 if (4 != match) continue;
323 327
324 LLUUID id(id_string); 328 LLUUID id(id_string);
@@ -409,7 +413,7 @@ BOOL LLCacheName::getName(const LLUUID& id, char* first, char* last)
409 { 413 {
410 //The function signature needs to change to pass in the 414 //The function signature needs to change to pass in the
411 //length of first and last. 415 //length of first and last.
412 strcpy(first,(frand(1.0f) < HIPPO_PROBABILITY) 416 strcpy(first,(ll_frand() < HIPPO_PROBABILITY)
413 ? CN_HIPPOS 417 ? CN_HIPPOS
414 : CN_WAITING); 418 : CN_WAITING);
415 strcpy(last, ""); 419 strcpy(last, "");