Let's not rely on integer underflows canceling each other...

This commit is contained in:
Alcaro 2016-02-24 20:25:53 +01:00
parent b398a0c185
commit 3f52b9e246
1 changed files with 4 additions and 4 deletions

View File

@ -346,11 +346,11 @@ static void menu_animation_ticker_generic(uint64_t idx,
if (phase < phase_left_stop)
*offset = 0;
else if (phase < phase_left_moving)
*offset = -left_offset;
*offset = left_offset;
else if (phase < phase_right_stop)
*offset = -(*width - max_width);
*offset = *width - max_width;
else
*offset = -right_offset;
*offset = right_offset;
*width = max_width;
}
@ -620,7 +620,7 @@ void menu_animation_ticker_str(char *s, size_t len, uint64_t idx,
menu_animation_ticker_generic(idx, len, &offset, &str_len);
strlcpy(s, str - offset, str_len + 1);
strlcpy(s, str + offset, str_len + 1);
anim->is_active = true;
}