summaryrefslogtreecommitdiffhomepage
path: root/nGenEx/ListBox.cpp
diff options
context:
space:
mode:
authorFWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544>2011-12-08 16:46:21 +0000
committerFWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544>2011-12-08 16:46:21 +0000
commit396c12ee73193f4ac3665ecac2f634fc0b046697 (patch)
tree16edb33b60f95f6bda93bc84b3f2eb81e316ba1d /nGenEx/ListBox.cpp
parent50971e84e295033941fac5291b08e593541fe945 (diff)
downloadstarshatter-396c12ee73193f4ac3665ecac2f634fc0b046697.zip
starshatter-396c12ee73193f4ac3665ecac2f634fc0b046697.tar.gz
starshatter-396c12ee73193f4ac3665ecac2f634fc0b046697.tar.bz2
Fixes for unsafe string handling, variable scoping errors.
Diffstat (limited to 'nGenEx/ListBox.cpp')
-rw-r--r--nGenEx/ListBox.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/nGenEx/ListBox.cpp b/nGenEx/ListBox.cpp
index 27671b1..182a438 100644
--- a/nGenEx/ListBox.cpp
+++ b/nGenEx/ListBox.cpp
@@ -241,7 +241,7 @@ ListBox::ListBox(ActiveWindow* p, int ax, int ay, int aw, int ah, DWORD aid)
seln_style = LIST_ITEM_STYLE_PLAIN;
char buf[32];
- sprintf(buf, "ListBox %d", id);
+ sprintf_s(buf, "ListBox %d", id);
desc = buf;
}
@@ -260,7 +260,7 @@ ListBox::ListBox(Screen* s, int ax, int ay, int aw, int ah, DWORD aid)
seln_style = LIST_ITEM_STYLE_PLAIN;
char buf[32];
- sprintf(buf, "ListBox %d", id);
+ sprintf_s(buf, "ListBox %d", id);
desc = buf;
}
@@ -1116,8 +1116,9 @@ int ListBox::OnLButtonDown(int x, int y)
if (show_headings && mouse_y < line_height+BORDER_WIDTH+EXTRA_WIDTH) {
int next_col_start = 0;
int max_column = columns.size()-1;
-
- for (int column = 0; column < max_column; column++) {
+ int column;
+
+ for (column = 0; column < max_column; column++) {
next_col_start += GetColumnWidth(column);
if (mouse_x < next_col_start)