syslogd/sysklogd-1.4.1-preserve_percents.patch

46 lines
1.3 KiB
Diff

--- klogd.c
+++ klogd.c 2004-12-02 20:58:17.026614000 +0000
@@ -740,7 +740,7 @@ static void LogLine(char *ptr, int len)
switch( parse_state )
{
case PARSING_TEXT:
- delta = copyin( line, space, ptr, len, "\n[%" );
+ delta = copyin( line, space, ptr, len, "\n[" );
line += delta;
ptr += delta;
space -= delta;
@@ -796,30 +796,9 @@ static void LogLine(char *ptr, int len)
parse_state = PARSING_SYMSTART; /* at < */
break;
}
- if( *ptr == '%' ) /* dangerous printf marker */
- {
- delta = 0;
- while (len && *ptr == '%')
- {
- *line++ = *ptr++; /* copy it in */
- space -= 1;
- len -= 1;
- delta++;
- }
- if (delta % 2) /* odd amount of %'s */
- {
- if (space)
- {
- *line++ = '%'; /* so simply add one */
- space -= 1;
- }
- else
- {
- *line++ = '\0'; /* remove the last one / terminate the string */
- }
-
- }
- }
+ /* Now that line_buff is no longer fed to *printf as format
+ * string, '%'s are no longer "dangerous".
+ */
break;
case PARSING_SYMSTART: