Skip to content

Commit

Permalink
err netconf BUGFIX more robust error message parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvasko committed Feb 2, 2024
1 parent b28857c commit 512dff7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/err_netconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ np_err_sr2nc_edit(sr_session_ctx_t *ev_sess, const sr_session_ctx_t *err_sess)
} else if (!strncmp(err->message, "Invalid type", 12) || !strncmp(err->message, "Unsatisfied range", 17) ||
!strncmp(err->message, "Unsatisfied pattern", 19) || strstr(err->message, "min/max bounds")) {
/* create error message */
str = strndup(err->message, (strchr(err->message, '.') + 1) - err->message);
str = strndup(err->message, (strrchr(err->message, '(') - 1) - err->message);

/* bad-element */
assert(path);
Expand Down

0 comments on commit 512dff7

Please sign in to comment.