mirror of
https://github.com/lbonn/rofi
synced 2024-11-15 08:37:17 +00:00
Fix possible issue with uninitialized data
This commit is contained in:
parent
6760453d80
commit
8b82787df6
2 changed files with 3 additions and 3 deletions
|
@ -213,7 +213,7 @@ static void get_apps ( DRunModePrivateData *pd )
|
|||
}
|
||||
|
||||
const char *d = g_get_user_data_dir ();
|
||||
for ( size_t i = 0; dr[i] != NULL; i++ ) {
|
||||
for ( size_t i = 0; dr && dr[i] != NULL; i++ ) {
|
||||
if ( g_strcmp0 ( d, dr[i] ) == 0 ) {
|
||||
// Done this already, no need to repeat.
|
||||
return;
|
||||
|
|
|
@ -174,13 +174,13 @@ static int lev_sort ( const void *p1, const void *p2, void *arg )
|
|||
|
||||
#define MIN3( a, b, c ) ( ( a ) < ( b ) ? ( ( a ) < ( c ) ? ( a ) : ( c ) ) : ( ( b ) < ( c ) ? ( b ) : ( c ) ) )
|
||||
|
||||
static int levenshtein ( const char *s1, const char *s2 )
|
||||
static unsigned int levenshtein ( const char *s1, const char *s2 )
|
||||
{
|
||||
unsigned int x, y, lastdiag, olddiag;
|
||||
size_t s1len = strlen ( s1 );
|
||||
size_t s2len = strlen ( s2 );
|
||||
unsigned int column[s1len + 1];
|
||||
for ( y = 1; y <= s1len; y++ ) {
|
||||
for ( y = 0; y <= s1len; y++ ) {
|
||||
column[y] = y;
|
||||
}
|
||||
for ( x = 1; x <= s2len; x++ ) {
|
||||
|
|
Loading…
Reference in a new issue