src/lib/message.c
static void send_to_syslog(int mode, const char *msg)
{
   int len;
   char buf[1024];
   const char *p2;
   const char *p = msg;

   while (*p && ((p2 = strchr(p, '\n')) != NULL)) {
      len = MIN((int)sizeof(buf) - 1, p2 - p + 1); /* Add 1 to keep \n */
      strncpy(buf, p, len);
      buf[len] = 0;
      syslog(mode, "%s", buf);
      p = p2+1;                 /* skip \n */
   }
   if (*p != 0) {               /* no \n at the end ? */
      syslog(mode, "%s", p);
   }
}
/* Split the output for syslog (it converts \n to ' ' and is
 *   limited to 1024 characters per syslog message
 */
Split the output for syslog (it converts \n to ' ' and is
limited to 1024 characters per syslog message
Split the output for syslog ( it converts \ n to ' ' and is limited to 1024 characters per syslog message
static void send_to_syslog(int mode, const char *msg)
{
   int len;
   char buf[1024];
   const char *p2;
   const char *p = msg;
   while (*p && ((p2 = strchr(p, '\n')) != NULL)) {
      len = MIN((int)sizeof(buf) - 1, p2 - p + 1); 
      strncpy(buf, p, len);
      buf[len] = 0;
      syslog(mode, "%s", buf);
      p = p2+1;                 
   }
   if (*p != 0) {               
      syslog(mode, "%s", p);
   }
}
static void send_to_syslog ( int mode , const char * msg ) { int len ; char buf [ 1024 ] ; const char * p2 ; const char * p = msg ; while ( * p && ( ( p2 = strchr ( p , ' \n ' ) ) != NULL ) ) { len = MIN ( ( int ) sizeof ( buf ) - 1 , p2 - p + 1 ) ; strncpy ( buf , p , len ) ; buf [ len ] = 0 ; syslog ( mode , " " , buf ) ; p = p2 + 1 ; } if ( * p != 0 ) { syslog ( mode , " " , p ) ; } }
Split the output for syslog (it converts \n to ' ' and is
   limited to 1024 characters per syslog message
Split the output for syslog ( it converts \ n to ' ' and is limited to 1024 characters per syslog message
/* Add 1 to keep \n */ /* skip \n */ /* no \n at the end ? */