To cut off a string at some position we must set the "precision" not the
field width in format strings.
This led to some assert()s being hit where they really should not be.
pamerr = "n/a"; /* We cannot have any formatting chars */
char buf[p - format + strlen(pamerr) + 1];
- xsprintf(buf, "%*s%s", (int)(p - format), format, pamerr);
+ xsprintf(buf, "%.*s%s", (int)(p - format), format, pamerr);
+
DISABLE_WARNING_FORMAT_NONLITERAL;
pam_vsyslog(handle, level, buf, ap);
REENABLE_WARNING;