Merge pull request #548 from pzychotic/fix-errors

Fix small collection of errors
This commit is contained in:
Louis Gombert 2024-09-08 22:41:46 +02:00 committed by GitHub
commit dfc192ac81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 5 deletions

View File

@ -1096,7 +1096,7 @@ int CheckTransparentPoint(const vector *pnt, const room *rp, const int facenum)
// Computes a bounding sphere for the current room
// Parameters: center - filled in with the center point of the sphere
// rp - the room were bounding
// rp - the room we're bounding
// Returns: the radius of the bounding sphere
float ComputeRoomBoundingSphere(vector *center, room *rp) {
// This algorithm is from Graphics Gems I. There's a better algorithm in Graphics Gems III that

View File

@ -191,7 +191,7 @@ void ddgr_FatalError(const char *fmt, ...) {
std::vsnprintf(buf, 768, fmt, arglist);
va_end(arglist);
if (DDGR_subsystems[i] = !-1) {
if (DDGR_subsystems[i] != -1) {
strcat(buf, "\n\nSubsystem: ");
strcat(buf, DDGR_subsystem_names[i]);
}

View File

@ -174,6 +174,6 @@ void con_raw_Destroy() {
// put some data up on the screen
void con_raw_Puts(int window, const char *str) {
fprintf(stdout, str, strlen(str));
fprintf(stdout, str);
fflush(stdout);
}

View File

@ -214,8 +214,10 @@ MenuItem::MenuItem(const char *title, char type, uint8_t flags, void (*fp)(int),
m_iState = va_arg(marker, int);
if ((SubMenuCount > 0) && (SubMenuCount < MAX_STATE_SUBMENUS)) {
SubMenus = (IMenuItem **)malloc(sizeof(IMenuItem *) * SubMenuCount);
if (!SubMenus)
if (!SubMenus) {
va_end(marker);
return;
}
char *string;
for (int i = 0; i < SubMenuCount; i++) {
string = va_arg(marker, char *);
@ -873,8 +875,10 @@ bool MenuItem::SetStateItemList(int count, ...) {
if ((SubMenuCount > 0) && (SubMenuCount < MAX_STATE_SUBMENUS)) {
SubMenus = (IMenuItem **)malloc(sizeof(IMenuItem *) * SubMenuCount);
if (!SubMenus)
if (!SubMenus) {
va_end(marker);
return false;
}
char *string;
for (int i = 0; i < SubMenuCount; i++) {
string = va_arg(marker, char *);