Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a couple of out-of-bounds warnings found by Clang. #263

Merged
merged 1 commit into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Descent3/Mission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ bool LoadMission(const char *mssn) {
for (int a = 0; a < MAX_MISSION_URL_COUNT; a++) {
if (Net_msn_URLs.URL[a][0] == '\0') {
strncpy(Net_msn_URLs.URL[a], operand, MAX_MISSION_URL_LEN - 1);
Net_msn_URLs.URL[a][MAX_MISSION_URL_LEN] = '\0';
Net_msn_URLs.URL[a][MAX_MISSION_URL_LEN - 1] = '\0';
mprintf((0, "Found a Mission URL: %s\n", operand));
break;
}
Expand Down
4 changes: 2 additions & 2 deletions netcon/includes/con_dll.h
Original file line number Diff line number Diff line change
Expand Up @@ -1167,9 +1167,9 @@ int StartMultiplayerGameMenu() {
if (!mi)
break;
strncpy(DLLNetgame->mission, mi->msn_file, MSN_NAMELEN);
DLLNetgame->mission[MSN_NAMELEN] = '\0';
DLLNetgame->mission[MSN_NAMELEN - 1] = '\0';
strncpy(DLLNetgame->mission_name, mi->msn_name, MISSION_NAME_LEN);
DLLNetgame->mission_name[MISSION_NAME_LEN] = '\0';
DLLNetgame->mission_name[MISSION_NAME_LEN - 1] = '\0';
#else
// strcpy(DLLNetgame->mission,DLLListGetSelectedIndex(list_1)?"thecore.d3l":"polaris.d3l");

Expand Down
1 change: 0 additions & 1 deletion scripts/AIGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5730,7 +5730,6 @@ bool GuideBot::DoInit(int me, bool f_reinit) {
memory->powerups[2] = 0;
memory->powerups[3] = 0;
memory->powerups[4] = 0;
memory->powerups[5] = 0;

for (i = 0; i < NUM_GB_SOUNDS; i++) {
memory->sounds[i] = -1;
Expand Down