Skip to content

Commit

Permalink
log_systemd: updated to use xavp long value field
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Nov 22, 2022
1 parent e06fb0a commit 24b3bf2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/modules/log_systemd/journal_send.c
Expand Up @@ -69,11 +69,11 @@ int k_sd_journal_send_xavp(str *rname)
nxavp;
nxavp = nxavp->next, cnt++)
{
if (nxavp->val.type == SR_XTYPE_INT) {
if (nxavp->val.type == SR_XTYPE_LONG) {
buflen = snprintf(NULL, 0,
"%.*s=%d",
"%.*s=%ld",
nxavp->name.len, nxavp->name.s,
nxavp->val.v.i);
nxavp->val.v.l);
logv[cnt].iov_base = pkg_malloc(buflen + 1/*snprintf's trailing \0*/);
if (!logv[cnt].iov_base ) {
LM_ERR("failed to allocate pkg memory\n");
Expand All @@ -82,9 +82,9 @@ int k_sd_journal_send_xavp(str *rname)
logv[cnt].iov_len = buflen;

snprintf(logv[cnt].iov_base, buflen + 1,
"%.*s=%d",
"%.*s=%ld",
nxavp->name.len, nxavp->name.s,
nxavp->val.v.i);
nxavp->val.v.l);
} else if (nxavp->val.type == SR_XTYPE_STR) {
buflen = nxavp->name.len + 1 + nxavp->val.v.s.len;
logv[cnt].iov_base = pkg_malloc(buflen);
Expand Down

0 comments on commit 24b3bf2

Please sign in to comment.