diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llpanelgrouplandmoney.cpp | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/linden/indra/newview/llpanelgrouplandmoney.cpp b/linden/indra/newview/llpanelgrouplandmoney.cpp index e7dcb9f..21f4d4b 100644 --- a/linden/indra/newview/llpanelgrouplandmoney.cpp +++ b/linden/indra/newview/llpanelgrouplandmoney.cpp | |||
@@ -226,9 +226,9 @@ int LLPanelGroupLandMoney::impl::getStoredContribution() | |||
226 | // Fills in the text field with the contribution, contrib | 226 | // Fills in the text field with the contribution, contrib |
227 | void LLPanelGroupLandMoney::impl::setYourContributionTextField(int contrib) | 227 | void LLPanelGroupLandMoney::impl::setYourContributionTextField(int contrib) |
228 | { | 228 | { |
229 | char buffer[MAX_STRING]; | 229 | char buffer[MAX_STRING]; /* Flawfinder: ignore*/ |
230 | buffer[0] = '\0'; | 230 | buffer[0] = '\0'; |
231 | sprintf(buffer, "%d", contrib); | 231 | snprintf(buffer, sizeof(buffer), "%d", contrib); /* Flawfinder: ignore*/ |
232 | 232 | ||
233 | if ( mYourContributionEditorp ) | 233 | if ( mYourContributionEditorp ) |
234 | { | 234 | { |
@@ -239,10 +239,10 @@ void LLPanelGroupLandMoney::impl::setYourContributionTextField(int contrib) | |||
239 | 239 | ||
240 | void LLPanelGroupLandMoney::impl::setYourMaxContributionTextBox(int max) | 240 | void LLPanelGroupLandMoney::impl::setYourMaxContributionTextBox(int max) |
241 | { | 241 | { |
242 | char buffer[MAX_STRING]; | 242 | char buffer[MAX_STRING]; /*Flawfinder: ignore*/ |
243 | buffer[0] = '\0'; | 243 | buffer[0] = '\0'; |
244 | 244 | ||
245 | sprintf(buffer, "(%d max)", max); | 245 | snprintf(buffer, sizeof(buffer), "(%d max)", max); /*Flawfinder: ignore*/ |
246 | if ( mYourContributionMaxTextp ) | 246 | if ( mYourContributionMaxTextp ) |
247 | { | 247 | { |
248 | mYourContributionMaxTextp->setText(buffer); | 248 | mYourContributionMaxTextp->setText(buffer); |
@@ -307,15 +307,15 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg) | |||
307 | ++first_block; | 307 | ++first_block; |
308 | S32 total_contribution; | 308 | S32 total_contribution; |
309 | msg->getS32("QueryData", "ActualArea", total_contribution, 0); | 309 | msg->getS32("QueryData", "ActualArea", total_contribution, 0); |
310 | char buffer[MAX_STRING]; | 310 | char buffer[MAX_STRING]; /*Flawfinder: ignore*/ |
311 | sprintf(buffer, "%d sq. meters", total_contribution); | 311 | snprintf(buffer, sizeof(buffer), "%d sq. meters", total_contribution); /*Flawfinder: ignore*/ |
312 | mTotalContributedLandp->setText(buffer); | 312 | mTotalContributedLandp->setText(buffer); |
313 | S32 committed; | 313 | S32 committed; |
314 | msg->getS32("QueryData", "BillableArea", committed, 0); | 314 | msg->getS32("QueryData", "BillableArea", committed, 0); |
315 | sprintf(buffer, "%d sq. meters", committed); | 315 | snprintf(buffer, sizeof(buffer), "%d sq. meters", committed); /*Flawfinder: ignore*/ |
316 | mTotalLandInUsep->setText(buffer); | 316 | mTotalLandInUsep->setText(buffer); |
317 | S32 available = total_contribution - committed; | 317 | S32 available = total_contribution - committed; |
318 | sprintf(buffer, "%d sq. meters", available); | 318 | snprintf(buffer, sizeof(buffer), "%d sq. meters", available); /*Flawfinder: ignore*/ |
319 | mLandAvailablep->setText(buffer); | 319 | mLandAvailablep->setText(buffer); |
320 | buffer[0] = '\0'; | 320 | buffer[0] = '\0'; |
321 | if ( mGroupOverLimitTextp && mGroupOverLimitIconp ) | 321 | if ( mGroupOverLimitTextp && mGroupOverLimitIconp ) |
@@ -336,14 +336,14 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg) | |||
336 | mMapButtonp->setEnabled(TRUE); | 336 | mMapButtonp->setEnabled(TRUE); |
337 | } | 337 | } |
338 | 338 | ||
339 | char name[MAX_STRING]; | 339 | char name[MAX_STRING]; /*Flawfinder: ignore*/ |
340 | char desc[MAX_STRING]; | 340 | char desc[MAX_STRING]; /*Flawfinder: ignore*/ |
341 | S32 actual_area; | 341 | S32 actual_area; |
342 | S32 billable_area; | 342 | S32 billable_area; |
343 | U8 flags; | 343 | U8 flags; |
344 | F32 global_x; | 344 | F32 global_x; |
345 | F32 global_y; | 345 | F32 global_y; |
346 | char sim_name[MAX_STRING]; | 346 | char sim_name[MAX_STRING]; /*Flawfinder: ignore*/ |
347 | for(S32 i = first_block; i < count; ++i) | 347 | for(S32 i = first_block; i < count; ++i) |
348 | { | 348 | { |
349 | msg->getUUID("QueryData", "OwnerID", owner_id, i); | 349 | msg->getUUID("QueryData", "OwnerID", owner_id, i); |
@@ -358,19 +358,19 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg) | |||
358 | 358 | ||
359 | S32 region_x = llround(global_x) % REGION_WIDTH_UNITS; | 359 | S32 region_x = llround(global_x) % REGION_WIDTH_UNITS; |
360 | S32 region_y = llround(global_y) % REGION_WIDTH_UNITS; | 360 | S32 region_y = llround(global_y) % REGION_WIDTH_UNITS; |
361 | char location[MAX_STRING]; | 361 | char location[MAX_STRING]; /*Flawfinder: ignore*/ |
362 | sprintf(location, "%s (%d, %d)", sim_name, region_x, region_y); | 362 | snprintf(location, MAX_STRING, "%s (%d, %d)", sim_name, region_x, region_y); /*Flawfinder: ignore*/ |
363 | char area[MAX_STRING]; | 363 | char area[MAX_STRING]; /*Flawfinder: ignore*/ |
364 | if(billable_area == actual_area) | 364 | if(billable_area == actual_area) |
365 | { | 365 | { |
366 | sprintf(area, "%d", billable_area); | 366 | snprintf(area, MAX_STRING, "%d", billable_area); /*Flawfinder: ignore*/ |
367 | } | 367 | } |
368 | else | 368 | else |
369 | { | 369 | { |
370 | sprintf(area, "%d / %d", billable_area, actual_area); | 370 | snprintf(area, MAX_STRING, "%d / %d", billable_area, actual_area); /*Flawfinder: ignore*/ |
371 | } | 371 | } |
372 | char hidden[MAX_STRING]; | 372 | char hidden[MAX_STRING]; /*Flawfinder: ignore*/ |
373 | sprintf(hidden, "%f %f", global_x, global_y); | 373 | snprintf(hidden, MAX_STRING, "%f %f", global_x, global_y); /*Flawfinder: ignore*/ |
374 | 374 | ||
375 | LLSD row; | 375 | LLSD row; |
376 | 376 | ||
@@ -977,10 +977,10 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg, | |||
977 | return; | 977 | return; |
978 | } | 978 | } |
979 | 979 | ||
980 | char line[MAX_STRING]; | 980 | char line[MAX_STRING]; /*Flawfinder: ignore*/ |
981 | LLString text; | 981 | LLString text; |
982 | 982 | ||
983 | char start_date[MAX_STRING]; | 983 | char start_date[MAX_STRING]; /*Flawfinder: ignore*/ |
984 | S32 interval_days; | 984 | S32 interval_days; |
985 | S32 current_interval; | 985 | S32 current_interval; |
986 | 986 | ||
@@ -996,7 +996,7 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg, | |||
996 | return; | 996 | return; |
997 | } | 997 | } |
998 | 998 | ||
999 | sprintf(line, "%s\n\n", start_date); | 999 | snprintf(line, MAX_STRING, "%s\n\n", start_date); /*Flawfinder: ignore*/ |
1000 | text.append(line); | 1000 | text.append(line); |
1001 | 1001 | ||
1002 | S32 total_amount = 0; | 1002 | S32 total_amount = 0; |
@@ -1004,14 +1004,14 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg, | |||
1004 | for(S32 i = 0; i < transactions; i++) | 1004 | for(S32 i = 0; i < transactions; i++) |
1005 | { | 1005 | { |
1006 | S32 amount = 0; | 1006 | S32 amount = 0; |
1007 | char desc[MAX_STRING]; | 1007 | char desc[MAX_STRING]; /*Flawfinder: ignore*/ |
1008 | 1008 | ||
1009 | msg->getStringFast(_PREHASH_HistoryData, _PREHASH_Description, MAX_STRING, desc, i ); | 1009 | msg->getStringFast(_PREHASH_HistoryData, _PREHASH_Description, MAX_STRING, desc, i ); |
1010 | msg->getS32Fast(_PREHASH_HistoryData, _PREHASH_Amount, amount, i); | 1010 | msg->getS32Fast(_PREHASH_HistoryData, _PREHASH_Amount, amount, i); |
1011 | 1011 | ||
1012 | if (amount != 0) | 1012 | if (amount != 0) |
1013 | { | 1013 | { |
1014 | sprintf(line, "%-24s %6d\n", desc, amount ); | 1014 | snprintf(line, MAX_STRING, "%-24s %6d\n", desc, amount ); /*Flawfinder: ignore*/ |
1015 | text.append(line); | 1015 | text.append(line); |
1016 | } | 1016 | } |
1017 | else | 1017 | else |
@@ -1024,7 +1024,7 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg, | |||
1024 | 1024 | ||
1025 | text.append(1, '\n'); | 1025 | text.append(1, '\n'); |
1026 | 1026 | ||
1027 | sprintf(line, "%-24s %6d\n", "Total", total_amount ); | 1027 | snprintf(line, MAX_STRING, "%-24s %6d\n", "Total", total_amount ); /*Flawfinder: ignore*/ |
1028 | text.append(line); | 1028 | text.append(line); |
1029 | 1029 | ||
1030 | if ( mImplementationp->mTextEditorp ) | 1030 | if ( mImplementationp->mTextEditorp ) |
@@ -1116,10 +1116,10 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg, | |||
1116 | return; | 1116 | return; |
1117 | } | 1117 | } |
1118 | 1118 | ||
1119 | char line[MAX_STRING]; | 1119 | char line[MAX_STRING]; /*Flawfinder: ignore*/ |
1120 | std::string text = mImplementationp->mTextEditorp->getText(); | 1120 | std::string text = mImplementationp->mTextEditorp->getText(); |
1121 | 1121 | ||
1122 | char start_date[MAX_STRING]; | 1122 | char start_date[MAX_STRING]; /*Flawfinder: ignore*/ |
1123 | S32 interval_days; | 1123 | S32 interval_days; |
1124 | S32 current_interval; | 1124 | S32 current_interval; |
1125 | 1125 | ||
@@ -1141,7 +1141,7 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg, | |||
1141 | { | 1141 | { |
1142 | text.clear(); | 1142 | text.clear(); |
1143 | 1143 | ||
1144 | sprintf(line, "%s\n\n", start_date); | 1144 | snprintf(line, MAX_STRING, "%s\n\n", start_date); /*Flawfinder: ignore*/ |
1145 | text.append(line); | 1145 | text.append(line); |
1146 | } | 1146 | } |
1147 | 1147 | ||
@@ -1155,11 +1155,11 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg, | |||
1155 | for(S32 i = 0; i < transactions; i++) | 1155 | for(S32 i = 0; i < transactions; i++) |
1156 | { | 1156 | { |
1157 | const S32 SHORT_STRING = 64; | 1157 | const S32 SHORT_STRING = 64; |
1158 | char time[SHORT_STRING]; | 1158 | char time[SHORT_STRING]; /*Flawfinder: ignore*/ |
1159 | S32 type = 0; | 1159 | S32 type = 0; |
1160 | S32 amount = 0; | 1160 | S32 amount = 0; |
1161 | char user[SHORT_STRING]; | 1161 | char user[SHORT_STRING]; /*Flawfinder: ignore*/ |
1162 | char item[SHORT_STRING]; | 1162 | char item[SHORT_STRING]; /*Flawfinder: ignore*/ |
1163 | 1163 | ||
1164 | msg->getStringFast(_PREHASH_HistoryData, _PREHASH_Time, SHORT_STRING, time, i); | 1164 | msg->getStringFast(_PREHASH_HistoryData, _PREHASH_Time, SHORT_STRING, time, i); |
1165 | msg->getStringFast(_PREHASH_HistoryData, _PREHASH_User, SHORT_STRING, user, i ); | 1165 | msg->getStringFast(_PREHASH_HistoryData, _PREHASH_User, SHORT_STRING, user, i ); |
@@ -1196,7 +1196,7 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg, | |||
1196 | break; | 1196 | break; |
1197 | } | 1197 | } |
1198 | 1198 | ||
1199 | sprintf(line, "%s %6d - %s %s %s\n", time, amount, user, verb, item); | 1199 | snprintf(line, sizeof(line), "%s %6d - %s %s %s\n", time, amount, user, verb, item); /*Flawfinder: ignore*/ |
1200 | text.append(line); | 1200 | text.append(line); |
1201 | } | 1201 | } |
1202 | } | 1202 | } |
@@ -1292,12 +1292,12 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg, | |||
1292 | return; | 1292 | return; |
1293 | } | 1293 | } |
1294 | 1294 | ||
1295 | char line[MAX_STRING]; | 1295 | char line[MAX_STRING]; /*Flawfinder: ignore*/ |
1296 | LLString text; | 1296 | LLString text; |
1297 | 1297 | ||
1298 | char start_date[MAX_STRING]; | 1298 | char start_date[MAX_STRING]; /*Flawfinder: ignore*/ |
1299 | char last_stipend_date[MAX_STRING]; | 1299 | char last_stipend_date[MAX_STRING]; /*Flawfinder: ignore*/ |
1300 | char next_stipend_date[MAX_STRING]; | 1300 | char next_stipend_date[MAX_STRING]; /*Flawfinder: ignore*/ |
1301 | S32 interval_days; | 1301 | S32 interval_days; |
1302 | S32 current_interval; | 1302 | S32 current_interval; |
1303 | S32 balance; | 1303 | S32 balance; |
@@ -1349,26 +1349,26 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg, | |||
1349 | return; | 1349 | return; |
1350 | } | 1350 | } |
1351 | 1351 | ||
1352 | sprintf(line, "Summary for this week, beginning on %s\n", start_date); | 1352 | snprintf(line, MAX_STRING, "Summary for this week, beginning on %s\n", start_date); /*Flawfinder: ignore*/ |
1353 | text.append(line); | 1353 | text.append(line); |
1354 | 1354 | ||
1355 | if (current_interval == 0) | 1355 | if (current_interval == 0) |
1356 | { | 1356 | { |
1357 | sprintf(line, "The next stipend day is %s\n\n", next_stipend_date); | 1357 | snprintf(line, MAX_STRING, "The next stipend day is %s\n\n", next_stipend_date); /*Flawfinder: ignore*/ |
1358 | text.append(line); | 1358 | text.append(line); |
1359 | sprintf(line, "%-24sL$%6d\n", "Balance", balance ); | 1359 | snprintf(line, MAX_STRING, "%-24sL$%6d\n", "Balance", balance ); /*Flawfinder: ignore*/ |
1360 | text.append(line); | 1360 | text.append(line); |
1361 | 1361 | ||
1362 | text.append(1, '\n'); | 1362 | text.append(1, '\n'); |
1363 | } | 1363 | } |
1364 | 1364 | ||
1365 | sprintf(line, " Group Individual Share\n"); | 1365 | snprintf(line, MAX_STRING, " Group Individual Share\n"); /*Flawfinder: ignore*/ |
1366 | text.append(line); | 1366 | text.append(line); |
1367 | sprintf(line, "%-24s %6d %6d \n", "Credits", total_credits, (S32)floor((F32)total_credits/(F32)non_exempt_members)); | 1367 | snprintf(line, MAX_STRING, "%-24s %6d %6d \n", "Credits", total_credits, (S32)floor((F32)total_credits/(F32)non_exempt_members)); /*Flawfinder: ignore*/ |
1368 | text.append(line); | 1368 | text.append(line); |
1369 | sprintf(line, "%-24s %6d %6d \n", "Debits", total_debits, (S32)floor((F32)total_debits/(F32)non_exempt_members)); | 1369 | snprintf(line, MAX_STRING, "%-24s %6d %6d \n", "Debits", total_debits, (S32)floor((F32)total_debits/(F32)non_exempt_members)); /*Flawfinder: ignore*/ |
1370 | text.append(line); | 1370 | text.append(line); |
1371 | sprintf(line, "%-24s %6d %6d \n", "Total", total_credits + total_debits, (S32)floor((F32)(total_credits + total_debits)/(F32)non_exempt_members)); | 1371 | snprintf(line, MAX_STRING, "%-24s %6d %6d \n", "Total", total_credits + total_debits, (S32)floor((F32)(total_credits + total_debits)/(F32)non_exempt_members)); /*Flawfinder: ignore*/ |
1372 | text.append(line); | 1372 | text.append(line); |
1373 | 1373 | ||
1374 | if ( mImplementationp->mTextEditorp ) | 1374 | if ( mImplementationp->mTextEditorp ) |