Skip to content

Commit 6d03ce1

Browse files
committed
make clang happy
1 parent cb3a17a commit 6d03ce1

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

fred2/waypointpathdlg.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ void waypoint_path_dlg::initialize_data(int full_update)
138138

139139
int waypoint_path_dlg::update_data(int redraw)
140140
{
141-
const char *str;
142-
char old_name[255];
143141
int i, z;
144142
object *ptr;
145143

@@ -264,9 +262,10 @@ int waypoint_path_dlg::update_data(int redraw)
264262
}
265263

266264

265+
char old_name[NAME_LENGTH];
267266
strcpy_s(old_name, cur_waypoint_list->get_name());
268267
cur_waypoint_list->set_name((LPCTSTR) m_name);
269-
str = cur_waypoint_list->get_name();
268+
auto str = cur_waypoint_list->get_name();
270269
if (strcmp(old_name, str)) {
271270
set_modified(TRUE);
272271
update_sexp_references(old_name, str);

qtfred/src/mission/dialogs/WaypointEditorDialogModel.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ bool WaypointEditorDialogModel::apply()
2222
}
2323

2424
// apply name
25-
char old_name[255];
25+
char old_name[NAME_LENGTH];
2626
strcpy_s(old_name, _editor->cur_waypoint_list->get_name());
2727
_editor->cur_waypoint_list->set_name(_currentName.c_str());
2828
auto str = _editor->cur_waypoint_list->get_name();
@@ -32,8 +32,8 @@ bool WaypointEditorDialogModel::apply()
3232
_editor->ai_update_goal_references(sexp_ref_type::WAYPOINT_PATH, old_name, str);
3333

3434
for (auto &wpt : _editor->cur_waypoint_list->get_waypoints()) {
35-
char old_buf[NAME_LENGTH + 8];
36-
char new_buf[NAME_LENGTH + 8];
35+
char old_buf[NAME_LENGTH + 12];
36+
char new_buf[NAME_LENGTH + 12];
3737
sprintf(old_buf, "%s:%d", old_name, wpt.get_index() + 1);
3838
sprintf(new_buf, "%s:%d", str, wpt.get_index() + 1);
3939
update_sexp_references(old_buf, new_buf);

0 commit comments

Comments
 (0)