fix state path kludge

This commit is contained in:
Olof hagsand 2020-05-02 17:08:54 +02:00
parent b4c591a985
commit 861f78f588
2 changed files with 4 additions and 6 deletions

View file

@ -256,9 +256,8 @@ clixon_plugin_statedata_all(clicon_handle h,
{
char *kpath;
if (xpath &&
(kpath = clicon_option_str(h, "CLICON_STATE_PATH_KLUDGE")) != NULL){
if (strncmp(xpath, kpath, strlen(kpath)) == 0)
;
(kpath = clicon_option_str(h, "CLICON_STATE_PATH_KLUDGE")) != NULL &&
strncmp(xpath, kpath, strlen(kpath)) == 0){
}
else {
#endif /* USE_STATE_PATH_KLUDGE */

View file

@ -731,9 +731,8 @@ clicon_rpc_get(clicon_handle h,
{
char *kpath;
if (xpath &&
(kpath = clicon_option_str(h, "CLICON_STATE_PATH_KLUDGE")) != NULL){
if (strncmp(xpath, kpath, strlen(kpath)) == 0)
;
(kpath = clicon_option_str(h, "CLICON_STATE_PATH_KLUDGE")) != NULL &&
strncmp(xpath, kpath, strlen(kpath)) == 0){
}
else
#endif /* USE_STATE_PATH_KLUDGE */