summaryrefslogtreecommitdiff
path: root/syslogd/proto.c
diff options
context:
space:
mode:
Diffstat (limited to 'syslogd/proto.c')
-rw-r--r--syslogd/proto.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/syslogd/proto.c b/syslogd/proto.c
index 3487dbd..8a285dd 100644
--- a/syslogd/proto.c
+++ b/syslogd/proto.c
@@ -169,9 +169,20 @@ int syslog_msg_parse(syslog_msg_t *msg, char *str)
ident = NULL;
}
+ if (ident != NULL && ident[0] == '\0')
+ ident = NULL;
+
msg->timestamp = mktime(&tstamp);
msg->pid = pid;
msg->ident = ident;
msg->message = str;
+
+ if (ident != NULL) {
+ for (ptr = ident; *ptr != '\0'; ++ptr) {
+ if (!isalnum(*ptr))
+ *ptr = '_';
+ }
+ }
+
return 0;
}