Patch by Matthew Fischer: Remove special treatment of the percent sign
authorJoey Schulze <joey@infodrom.org>
Mon, 28 May 2007 16:08:32 +0000 (16:08 +0000)
committerJoey Schulze <joey@infodrom.org>
Mon, 28 May 2007 16:08:32 +0000 (16:08 +0000)
klogd.c

diff --git a/klogd.c b/klogd.c
index d0d8dd0..be5e769 100644 (file)
--- a/klogd.c
+++ b/klogd.c
  *     kernel log rinbuffer.
  *
  * Sat May 26 16:33:18 2007: Martin Schulze <joey@infodrom.org>
- *     Improved daemonise routine to stabilise startup
+ *     Improved daemonise routine to stabilise startup.
  *
+ * Mon May 28 18:07:59 CEST 2007: Matthew Fischer <futhark@vzavenue.net>
+ *     Remove special treatment of the percent sign.
  */
 
 
@@ -755,7 +757,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;
@@ -811,30 +813,6 @@ 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 */
-                      }
-
-                  }
-              }
                break;
         
         case PARSING_SYMSTART: