Skip to content

Commit

Permalink
coerce S_NUM value
Browse files Browse the repository at this point in the history
  • Loading branch information
rfomin committed Oct 2, 2024
1 parent b504078 commit a316195
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/mn_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -4024,36 +4024,36 @@ static boolean ChangeEntry(menu_action_t action, int ch)
{
if (gather_count) // Any input?
{
int value;

gather_buffer[gather_count] = 0;
value = atoi(gather_buffer); // Integer value

if ((def->limit.min != UL && value < def->limit.min)
|| (def->limit.max != UL && value > def->limit.max))
int value = atoi(gather_buffer); // Integer value

int min = def->limit.min;
int max = def->limit.max;

if ((min != UL && value < min) || (max != UL && value > max))
{
warn_about_changes(S_BADVAL);
value = BETWEEN(min, max, value);
}
else
{
def->location->i = value;

// killough 8/9/98: fix numeric vars
// killough 8/15/98: add warning message
def->location->i = value;

if (flags & (S_LEVWARN | S_PRGWARN))
{
warn_about_changes(flags);
}
else if (def->current)
{
def->current->i = value;
}
// killough 8/9/98: fix numeric vars
// killough 8/15/98: add warning message

if (current_item->action) // killough 10/98
{
current_item->action();
}
if (flags & (S_LEVWARN | S_PRGWARN))
{
warn_about_changes(flags);
}
else if (def->current)
{
def->current->i = value;
}

if (current_item->action) // killough 10/98
{
current_item->action();
}
}
SelectDone(current_item); // phares 4/17/98
Expand Down

0 comments on commit a316195

Please sign in to comment.