Skip to content
Snippets Groups Projects
Commit bf012223 authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

avoid to crash if no tree is enabled yet

parent e02f6763
No related branches found
No related tags found
No related merge requests found
......@@ -447,7 +447,7 @@ static void info_parse_options(char const *str,int *what)
stralloc_free(&sa) ;
}
#include <stdio.h>
int main(int argc, char const *const *argv, char const *const *envp)
{
unsigned int legacy = 1 ;
......@@ -568,8 +568,12 @@ int main(int argc, char const *const *argv, char const *const *envp)
if (!file_readputsa(&enabled,src.s,"state"))
log_dieusys(LOG_EXIT_SYS,"read contents of file: ",src.s,"/state") ;
if (!sastr_split_string_in_nline(&enabled))
log_dieu(LOG_EXIT_SYS,"rebuild enabled tree list") ;
/** May not have enabled tree yet */
if (enabled.len) {
if (!sastr_split_string_in_nline(&enabled))
log_dieu(LOG_EXIT_SYS,"rebuild enabled tree list") ;
}
info_sort_enabled_notenabled(&satree,&enabled,&not_enabled) ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment