The parameter
ident in the call of
openlog() is probably stored as-is. Thus, if the string it points to
is changed,
syslog() may start prepending the changed string, and if the string
it points to ceases to exist, the results are undefined.
Most portable is to use a string constant.
Never pass a string with user-supplied data as a format, use
syslog(priority, "%s", string);
instead.