aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llstatbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llstatbar.cpp')
-rw-r--r--linden/indra/newview/llstatbar.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/linden/indra/newview/llstatbar.cpp b/linden/indra/newview/llstatbar.cpp
index b23840a..4b7067c 100644
--- a/linden/indra/newview/llstatbar.cpp
+++ b/linden/indra/newview/llstatbar.cpp
@@ -143,17 +143,17 @@ void LLStatBar::draw()
143 LLFontGL::sMonospace->renderUTF8(mLabel, 0, 0, mRect.getHeight(), LLColor4(1.f, 1.f, 1.f, 1.f), 143 LLFontGL::sMonospace->renderUTF8(mLabel, 0, 0, mRect.getHeight(), LLColor4(1.f, 1.f, 1.f, 1.f),
144 LLFontGL::LEFT, LLFontGL::TOP); 144 LLFontGL::LEFT, LLFontGL::TOP);
145 145
146 char value_format[64]; 146 char value_format[64]; /* Flawfinder: ignore */
147 char value_str[256]; 147 char value_str[256]; /* Flawfinder: ignore */
148 if (!mUnitLabel.empty()) 148 if (!mUnitLabel.empty())
149 { 149 {
150 sprintf(value_format, "%%.%df%%s", mPrecision); 150 snprintf(value_format, sizeof(value_format), "%%.%df%%s", mPrecision); /* Flawfinder: ignore */
151 sprintf(value_str, value_format, mValue, mUnitLabel.c_str()); 151 snprintf(value_str, sizeof(value_str), value_format, mValue, mUnitLabel.c_str()); /* Flawfinder: ignore */
152 } 152 }
153 else 153 else
154 { 154 {
155 sprintf(value_format, "%%.%df", mPrecision); 155 snprintf(value_format, sizeof(value_format), "%%.%df", mPrecision); /* Flawfinder: ignore */
156 sprintf(value_str, value_format, mValue); 156 snprintf(value_str, sizeof(value_str), value_format, mValue); /* Flawfinder: ignore */
157 } 157 }
158 158
159 // Draw the value. 159 // Draw the value.
@@ -161,10 +161,10 @@ void LLStatBar::draw()
161 LLColor4(1.f, 1.f, 1.f, 0.5f), 161 LLColor4(1.f, 1.f, 1.f, 0.5f),
162 LLFontGL::RIGHT, LLFontGL::TOP); 162 LLFontGL::RIGHT, LLFontGL::TOP);
163 163
164 sprintf(value_format, "%%.%df", mPrecision); 164 snprintf(value_format, sizeof(value_format), "%%.%df", mPrecision); /* Flawfinder: ignore */
165 if (mDisplayBar) 165 if (mDisplayBar)
166 { 166 {
167 char tick_label[256]; 167 char tick_label[256]; /* Flawfinder: ignore */
168 168
169 // Draw the tick marks. 169 // Draw the tick marks.
170 F32 tick_value; 170 F32 tick_value;
@@ -188,7 +188,7 @@ void LLStatBar::draw()
188 right = left + tick_width; 188 right = left + tick_width;
189 gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.25f)); 189 gl_rect_2d(left, top, right, bottom, LLColor4(1.f, 1.f, 1.f, 0.25f));
190 190
191 sprintf(tick_label, value_format, tick_value); 191 snprintf(tick_label, sizeof(tick_label), value_format, tick_value); /* Flawfinder: ignore */
192 // draw labels for the tick marks 192 // draw labels for the tick marks
193 LLFontGL::sMonospace->renderUTF8(tick_label, 0, left - 1, bar_top - bar_height - tick_height, 193 LLFontGL::sMonospace->renderUTF8(tick_label, 0, left - 1, bar_top - bar_height - tick_height,
194 LLColor4(1.f, 1.f, 1.f, 0.5f), 194 LLColor4(1.f, 1.f, 1.f, 0.5f),