aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerinventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewerinventory.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/linden/indra/newview/llviewerinventory.cpp b/linden/indra/newview/llviewerinventory.cpp
index 487a9f8..7c12f56 100644
--- a/linden/indra/newview/llviewerinventory.cpp
+++ b/linden/indra/newview/llviewerinventory.cpp
@@ -268,7 +268,7 @@ bool LLViewerInventoryItem::importFileLocal(FILE* fp)
268 268
269bool LLViewerInventoryItem::exportFileLocal(FILE* fp) const 269bool LLViewerInventoryItem::exportFileLocal(FILE* fp) const
270{ 270{
271 char uuid_str[UUID_STR_LENGTH]; 271 char uuid_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
272 fprintf(fp, "\tinv_item\t0\n\t{\n"); 272 fprintf(fp, "\tinv_item\t0\n\t{\n");
273 mUUID.toString(uuid_str); 273 mUUID.toString(uuid_str);
274 fprintf(fp, "\t\titem_id\t%s\n", uuid_str); 274 fprintf(fp, "\t\titem_id\t%s\n", uuid_str);
@@ -450,16 +450,17 @@ bool LLViewerInventoryCategory::fetchDescendents()
450bool LLViewerInventoryCategory::importFileLocal(FILE* fp) 450bool LLViewerInventoryCategory::importFileLocal(FILE* fp)
451{ 451{
452 // *NOTE: This buffer size is hard coded into scanf() below. 452 // *NOTE: This buffer size is hard coded into scanf() below.
453 char buffer[MAX_STRING]; 453 char buffer[MAX_STRING]; /* Flawfinder: ignore */
454 char keyword[MAX_STRING]; 454 char keyword[MAX_STRING]; /* Flawfinder: ignore */
455 char valuestr[MAX_STRING]; 455 char valuestr[MAX_STRING]; /* Flawfinder: ignore */
456 456
457 keyword[0] = '\0'; 457 keyword[0] = '\0';
458 valuestr[0] = '\0'; 458 valuestr[0] = '\0';
459 while(!feof(fp)) 459 while(!feof(fp))
460 { 460 {
461 fgets(buffer, MAX_STRING, fp); 461 fgets(buffer, MAX_STRING, fp);
462 sscanf(buffer, " %254s %254s", keyword, valuestr); 462 sscanf( /* Flawfinder: ignore */
463 buffer, " %254s %254s", keyword, valuestr);
463 if(!keyword) 464 if(!keyword)
464 { 465 {
465 continue; 466 continue;
@@ -492,7 +493,8 @@ bool LLViewerInventoryCategory::importFileLocal(FILE* fp)
492 { 493 {
493 //strcpy(valuestr, buffer + strlen(keyword) + 3); 494 //strcpy(valuestr, buffer + strlen(keyword) + 3);
494 // *NOTE: Not ANSI C, but widely supported. 495 // *NOTE: Not ANSI C, but widely supported.
495 sscanf(buffer, " %254s %254[^|]", keyword, valuestr); 496 sscanf( /* Flawfinder: ignore */
497 buffer, " %254s %254[^|]", keyword, valuestr);
496 mName.assign(valuestr); 498 mName.assign(valuestr);
497 LLString::replaceNonstandardASCII(mName, ' '); 499 LLString::replaceNonstandardASCII(mName, ' ');
498 LLString::replaceChar(mName, '|', ' '); 500 LLString::replaceChar(mName, '|', ' ');
@@ -516,7 +518,7 @@ bool LLViewerInventoryCategory::importFileLocal(FILE* fp)
516 518
517bool LLViewerInventoryCategory::exportFileLocal(FILE* fp) const 519bool LLViewerInventoryCategory::exportFileLocal(FILE* fp) const
518{ 520{
519 char uuid_str[UUID_STR_LENGTH]; 521 char uuid_str[UUID_STR_LENGTH]; /* Flawfinder: ignore */
520 fprintf(fp, "\tinv_category\t0\n\t{\n"); 522 fprintf(fp, "\tinv_category\t0\n\t{\n");
521 mUUID.toString(uuid_str); 523 mUUID.toString(uuid_str);
522 fprintf(fp, "\t\tcat_id\t%s\n", uuid_str); 524 fprintf(fp, "\t\tcat_id\t%s\n", uuid_str);
@@ -672,7 +674,7 @@ void copy_inventory_item(
672 msg->addUUIDFast(_PREHASH_OldAgentID, current_owner); 674 msg->addUUIDFast(_PREHASH_OldAgentID, current_owner);
673 msg->addUUIDFast(_PREHASH_OldItemID, item_id); 675 msg->addUUIDFast(_PREHASH_OldItemID, item_id);
674 msg->addUUIDFast(_PREHASH_NewFolderID, parent_id); 676 msg->addUUIDFast(_PREHASH_NewFolderID, parent_id);
675 msg->addString("NewName", new_name); 677 msg->addStringFast(_PREHASH_NewName, new_name);
676 gAgent.sendReliableMessage(); 678 gAgent.sendReliableMessage();
677} 679}
678 680
@@ -689,11 +691,11 @@ void move_inventory_item(
689 msg->nextBlockFast(_PREHASH_AgentData); 691 msg->nextBlockFast(_PREHASH_AgentData);
690 msg->addUUIDFast(_PREHASH_AgentID, agent_id); 692 msg->addUUIDFast(_PREHASH_AgentID, agent_id);
691 msg->addUUIDFast(_PREHASH_SessionID, session_id); 693 msg->addUUIDFast(_PREHASH_SessionID, session_id);
692 msg->addBOOLFast(_PREHASH_Stamp, false); 694 msg->addBOOLFast(_PREHASH_Stamp, FALSE);
693 msg->nextBlockFast(_PREHASH_InventoryData); 695 msg->nextBlockFast(_PREHASH_InventoryData);
694 msg->addUUIDFast(_PREHASH_ItemID, item_id); 696 msg->addUUIDFast(_PREHASH_ItemID, item_id);
695 msg->addUUIDFast(_PREHASH_FolderID, parent_id); 697 msg->addUUIDFast(_PREHASH_FolderID, parent_id);
696 msg->addString("NewName", new_name); 698 msg->addStringFast(_PREHASH_NewName, new_name);
697 gAgent.sendReliableMessage(); 699 gAgent.sendReliableMessage();
698} 700}
699 701