chiark / gitweb /
bus: fix counting of argN= matches
[elogind.git] / src / journal / journald-server.c
index 6f283df74be9c4cb86259df7a1735a7d2f032c99..be84323a6c0623446d68d404688330ed1ec4016c 100644 (file)
@@ -538,15 +538,18 @@ static void dispatch_message_real(
         char pid[sizeof("_PID=") + DECIMAL_STR_MAX(ucred->pid)],
                 uid[sizeof("_UID=") + DECIMAL_STR_MAX(ucred->uid)],
                 gid[sizeof("_GID=") + DECIMAL_STR_MAX(ucred->gid)],
-                source_time[sizeof("_SOURCE_REALTIME_TIMESTAMP=" + DECIMAL_STR_MAX(usec_t))],
+                source_time[sizeof("_SOURCE_REALTIME_TIMESTAMP=") + DECIMAL_STR_MAX(usec_t)],
                 boot_id[sizeof("_BOOT_ID=") + 32] = "_BOOT_ID=",
                 machine_id[sizeof("_MACHINE_ID=") + 32] = "_MACHINE_ID=";
 
         char _cleanup_free_ *comm = NULL, *cmdline = NULL, *hostname = NULL,
-                *audit_session = NULL, *audit_loginuid = NULL,
                 *exe = NULL, *cgroup = NULL, *session = NULL,
                 *owner_uid = NULL, *unit = NULL, *selinux_context = NULL;
 
+#ifdef HAVE_AUDIT
+        char _cleanup_free_ *audit_session = NULL, *audit_loginuid = NULL;
+#endif
+
         sd_id128_t id;
         int r;
         char *t;
@@ -696,7 +699,7 @@ static void dispatch_message_real(
 
         r = sd_id128_get_machine(&id);
         if (r >= 0) {
-                sd_id128_to_string(id, machine_id + sizeof("_MACHINE_ID") - 1);
+                sd_id128_to_string(id, machine_id + sizeof("_MACHINE_ID=") - 1);
                 IOVEC_SET_STRING(iovec[n++], machine_id);
         }