mirror of https://github.com/davatorium/rofi.git
[Window] On window name list, Check if we go out of range.
This commit is contained in:
parent
135ff94a79
commit
0e880e76a2
|
@ -453,6 +453,7 @@ static unsigned int window_mode_get_num_entries ( const Mode *sw )
|
||||||
* Small helper function to find the right entry in the ewmh reply.
|
* Small helper function to find the right entry in the ewmh reply.
|
||||||
* Is there a call for this?
|
* Is there a call for this?
|
||||||
*/
|
*/
|
||||||
|
const char *invalid_desktop_name = "n/a";
|
||||||
static const char * _window_name_list_entry ( const char *str, uint32_t length, int entry )
|
static const char * _window_name_list_entry ( const char *str, uint32_t length, int entry )
|
||||||
{
|
{
|
||||||
uint32_t offset = 0;
|
uint32_t offset = 0;
|
||||||
|
@ -463,6 +464,9 @@ static const char * _window_name_list_entry ( const char *str, uint32_t length,
|
||||||
}
|
}
|
||||||
offset++;
|
offset++;
|
||||||
}
|
}
|
||||||
|
if ( offset >= length ){
|
||||||
|
return invalid_desktop_name;
|
||||||
|
}
|
||||||
return &str[offset];
|
return &str[offset];
|
||||||
}
|
}
|
||||||
static void _window_mode_load_data ( Mode *sw, unsigned int cd )
|
static void _window_mode_load_data ( Mode *sw, unsigned int cd )
|
||||||
|
|
Loading…
Reference in New Issue