1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2025-02-03 15:34:54 -05:00

Fix some coverty found issues.

This commit is contained in:
Dave Davenport 2016-10-17 20:54:41 +02:00
parent df26193096
commit b622a98d9c
3 changed files with 10 additions and 5 deletions

View file

@ -303,12 +303,16 @@ static void dmenu_output_formatted_line ( const char *format, const char *string
g_free ( quote );
}
else if ( format[i] == 'f' ) {
fputs ( filter, stdout );
if ( filter ) {
fputs ( filter, stdout );
}
}
else if ( format[i] == 'F' ) {
char *quote = g_shell_quote ( filter );
fputs ( quote, stdout );
g_free ( quote );
if ( filter ) {
char *quote = g_shell_quote ( filter );
fputs ( quote, stdout );
g_free ( quote );
}
}
else {
fputc ( format[i], stdout );

View file

@ -270,6 +270,7 @@ static char ** get_apps ( unsigned int *length )
if ( error != NULL ) {
g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Failed to convert directory name to UTF-8: %s", error->message );
g_clear_error ( &error );
closedir ( dir );
continue;
}
gboolean is_homedir = g_str_has_prefix ( dirn, homedir );

View file

@ -1254,7 +1254,7 @@ static void rofi_view_mainloop_iter ( RofiViewState *state, xcb_generic_event_t
{
xcb_keymap_notify_event_t *kne = (xcb_keymap_notify_event_t *) ev;
guint modstate = x11_get_current_mask ( xkb );
for ( gint32 by = 0; by < 32; ++by ) {
for ( gint32 by = 0; by < 31; ++by ) {
for ( gint8 bi = 0; bi < 7; ++bi ) {
if ( kne->keys[by] & ( 1 << bi ) ) {
// X11 keycodes starts at 8