Fix some warning that converity scan picked up.

This commit is contained in:
Dave Davenport 2017-04-06 19:55:47 +02:00
parent 898b5466f0
commit b227fece10
2 changed files with 8 additions and 2 deletions

View file

@ -678,6 +678,10 @@ char *rofi_expand_path ( const char *input )
unsigned int levenshtein ( const char *needle, const glong needlelen, const char *haystack, const glong haystacklen )
{
if ( needlelen == G_MAXLONG ){
// String to long, we cannot handle this.
return UINT_MAX;
}
unsigned int column[needlelen + 1];
for ( glong y = 0; y <= needlelen; y++ ) {
column[y] = y;

View file

@ -238,7 +238,9 @@ static void rofi_theme_print_index ( ThemeWidget *widget )
}
void rofi_theme_print ( ThemeWidget *widget )
{
rofi_theme_print_index ( widget );
if ( widget != NULL ) {
rofi_theme_print_index ( widget );
}
}
/**
@ -382,7 +384,7 @@ Property *rofi_theme_find_property ( ThemeWidget *widget, PropertyType type, con
// Resolve link.
rofi_theme_resolve_link_property ( p, 0 );
}
if ( p->value.link.ref->type == type ) {
if ( p->value.link.ref != NULL && p->value.link.ref->type == type ) {
return p->value.link.ref;
}
}