mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-25 13:55:34 -05:00
Make analysis happy and prefer heap over stack.
This commit is contained in:
parent
479123fcef
commit
7e6a24f9b6
1 changed files with 5 additions and 2 deletions
|
@ -781,15 +781,18 @@ static int levenshtein ( const char *s, const char *t )
|
|||
{
|
||||
int ls = strlen ( s ), lt = strlen ( t );
|
||||
size_t array_length = ( ls + 1 ) * ( lt + 1 );
|
||||
|
||||
// For some reason Coverity does not get that I initialize the
|
||||
// array in for loop.
|
||||
int d[array_length];
|
||||
int *d = g_malloc_n ( array_length, sizeof ( int ) );
|
||||
|
||||
for ( size_t i = 0; i < array_length; i++ ) {
|
||||
d[i] = -1;
|
||||
}
|
||||
|
||||
return dist ( s, t, d, ls, lt, 0, 0 );
|
||||
int retv = dist ( s, t, d, ls, lt, 0, 0 );
|
||||
g_free ( d );
|
||||
return retv;
|
||||
}
|
||||
|
||||
static void window_set_opacity ( Display *display, Window box, unsigned int opacity )
|
||||
|
|
Loading…
Reference in a new issue