From: Martin Quinson Date: Tue, 2 May 2017 12:13:09 +0000 (+0200) Subject: Make the logs more robust to user's stupidity X-Git-Tag: v3.16~290 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ebfcbadbed395571dcfb1891f1848d7f9b64214b?hp=678fd6f4cec087a6acd30ef519fbcbcf3cf1e552 Make the logs more robust to user's stupidity --- diff --git a/src/xbt/log.c b/src/xbt/log.c index e9ed472a00..9e3da3c0a2 100644 --- a/src/xbt/log.c +++ b/src/xbt/log.c @@ -602,13 +602,12 @@ static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string) control_string += strspn(control_string, " "); const char *name = control_string; - control_string += strcspn(control_string, ".= "); + control_string += strcspn(control_string, ".:= "); const char *dot = control_string; control_string += strcspn(control_string, ":= "); const char *eq = control_string; - if(*dot != '.' && (*eq == '=' || *eq == ':')) - xbt_die ("Invalid control string '%s'", orig_control_string); + xbt_assert(*dot == '.' || (*eq != '=' && *eq != ':'), "Invalid control string '%s'", orig_control_string); if (!strncmp(dot + 1, "threshold", (size_t) (eq - dot - 1))) { int i; @@ -678,7 +677,7 @@ static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string) } else { char buff[512]; snprintf(buff, MIN(512, eq - dot), "%s", dot + 1); - THROWF(arg_error, 0, "Unknown setting of the log category: '%s'", buff); + xbt_die("Unknown setting of the log category: '%s'", buff); } set->catname = (char *) xbt_malloc(dot - name + 1);