Fix a crash due to overlapping arguments of memcpy(3).

As the use of memcpy(3) on overlapping memory regions is strictly undefined,
OpenBSD's memcpy(3) triggers an abort in such cases.
This commit is contained in:
Jasper Lievisse Adriaanse 2016-01-03 21:20:24 +01:00
parent 96724356e1
commit b2bc07e51d
1 changed files with 1 additions and 1 deletions

View File

@ -940,7 +940,7 @@ static void menu_refilter ( MenuState *state )
g_mutex_clear ( &mutex );
for ( unsigned int i = 0; i < nt; i++ ) {
if ( j != states[i].start ) {
memcpy ( &( state->line_map[j] ), &( state->line_map[states[i].start] ), sizeof ( unsigned int ) * ( states[i].count ) );
memmove ( &( state->line_map[j] ), &( state->line_map[states[i].start] ), sizeof ( unsigned int ) * ( states[i].count ) );
}
j += states[i].count;
}