From 41cd7a2e3e99efd1b06e8d5694fada267da78811 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Wed, 17 May 2023 16:36:06 +0200 Subject: [PATCH] exec: clang-format for coherent indentation and coding style --- src/modules/exec/exec.c | 18 +++++++++--------- src/modules/exec/exec_hf.c | 15 ++++++++------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/modules/exec/exec.c b/src/modules/exec/exec.c index 763e30816e7..905d6439eb1 100644 --- a/src/modules/exec/exec.c +++ b/src/modules/exec/exec.c @@ -156,8 +156,8 @@ int exec_str(struct sip_msg *msg, char *cmd, char *param, int param_len) /* trim from right */ while(uri.len && (uri.s[uri.len - 1] == '\r' || uri.s[uri.len - 1] == '\n' - || uri.s[uri.len - 1] == '\t' - || uri.s[uri.len - 1] == ' ')) { + || uri.s[uri.len - 1] == '\t' + || uri.s[uri.len - 1] == ' ')) { LM_DBG("rtrim\n"); uri.len--; } @@ -248,8 +248,8 @@ int exec_avp(struct sip_msg *msg, char *cmd, pvname_list_p avpl) /* trim from right */ while(res.len && (res.s[res.len - 1] == '\r' || res.s[res.len - 1] == '\n' - || res.s[res.len - 1] == '\t' - || res.s[res.len - 1] == ' ')) { + || res.s[res.len - 1] == '\t' + || res.s[res.len - 1] == ' ')) { res.len--; } /* skip empty line */ @@ -328,15 +328,15 @@ int exec_cmd(sip_msg_t *msg, char *cmd) /* return false if script exited with non-zero status */ if(WEXITSTATUS(exit_status) != 0) { LM_DBG("cmd %s with non-zero status - exit_status=%d," - " wexitstatus: %d, errno=%d: %s\n", - cmd, exit_status, WEXITSTATUS(exit_status), - errno, strerror(errno)); + " wexitstatus: %d, errno=%d: %s\n", + cmd, exit_status, WEXITSTATUS(exit_status), errno, + strerror(errno)); ret = -1; } } else { /* exited erroneously */ LM_ERR("cmd %s failed. exit_status=%d, wexitstatus: %d, errno=%d: %s\n", - cmd, exit_status, WEXITSTATUS(exit_status), - errno, strerror(errno)); + cmd, exit_status, WEXITSTATUS(exit_status), errno, + strerror(errno)); ret = -1; } diff --git a/src/modules/exec/exec_hf.c b/src/modules/exec/exec_hf.c index 8f4b52f8147..e51a18e78a2 100644 --- a/src/modules/exec/exec_hf.c +++ b/src/modules/exec/exec_hf.c @@ -79,8 +79,8 @@ static int insert_hf(struct hf_wrapper **list, struct hdr_field *hf) if(hf->type == HDR_OTHER_T && (hf->name.len != i->u.hf->name.len || strncasecmp(i->u.hf->name.s, hf->name.s, - hf->name.len) - != 0)) + hf->name.len) + != 0)) continue; /* yes, we found a hf of same type */ w->next_same = i->next_same; @@ -472,7 +472,7 @@ static int append_fixed_vars(struct sip_msg *msg, struct hf_wrapper **list) } /* request URI */ uri = msg->new_uri.s && msg->new_uri.len ? &msg->new_uri - : &msg->first_line.u.request.uri; + : &msg->first_line.u.request.uri; if(!append_var(EV_RURI, uri->s, uri->len, list)) { LM_ERR("append_var URI failed\n"); return 0; @@ -488,19 +488,20 @@ static int append_fixed_vars(struct sip_msg *msg, struct hf_wrapper **list) } /* original URI */ if(!append_var(EV_ORURI, msg->first_line.u.request.uri.s, - msg->first_line.u.request.uri.len, list)) { + msg->first_line.u.request.uri.len, list)) { LM_ERR("append_var O-URI failed\n"); goto error; } /* userpart of request URI */ if(parse_uri(msg->first_line.u.request.uri.s, - msg->first_line.u.request.uri.len, &oparsed_uri) < 0) { + msg->first_line.u.request.uri.len, &oparsed_uri) + < 0) { LM_WARN("orig URI not parsed (%.*s)\n", msg->first_line.u.request.uri.len, - ZSW( msg->first_line.u.request.uri.s)); + ZSW(msg->first_line.u.request.uri.s)); } else { if(!append_var( - EV_OUSER, oparsed_uri.user.s, oparsed_uri.user.len, list)) { + EV_OUSER, oparsed_uri.user.s, oparsed_uri.user.len, list)) { LM_ERR("append_var OUSER failed\n"); goto error; }