diff --git a/meson.build b/meson.build index 9e413fe..e141508 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('wofi', 'c', version : 'v1.4.1', default_options : ['c_std=c99', 'buildtype=release', 'warning_level=2']) +project('wofi', 'c', version : 'hg', default_options : ['c_std=c99', 'buildtype=release', 'warning_level=2']) cc = meson.get_compiler('c') pkgcfg = import('pkgconfig') diff --git a/src/wofi.c b/src/wofi.c index 82755c0..10cfe7a 100644 --- a/src/wofi.c +++ b/src/wofi.c @@ -926,7 +926,16 @@ struct wl_list* wofi_read_cache(struct mode* mode) { smallest_node = node; } } - char* tmp = strdup(strchr(smallest_node->line, ' ') + 1); + + char* space = strchr(smallest_node->line, ' '); + + if(space == NULL) { + free(smallest_node->line); + wl_list_remove(&smallest_node->link); + continue; + } + + char* tmp = strdup(space + 1); free(smallest_node->line); smallest_node->line = tmp; wl_list_remove(&smallest_node->link);