src/lib/message.c
int m_msg(const char *file, int line, POOLMEM **pool_buf, const char *fmt, ...)
{
   va_list   arg_ptr;
   int i, len, maxlen;

   i = sprintf(*pool_buf, "%s:%d ", get_basename(file), line);

   for (;;) {
      maxlen = sizeof_pool_memory(*pool_buf) - i - 1;
      va_start(arg_ptr, fmt);
      len = bvsnprintf(*pool_buf+i, maxlen, fmt, arg_ptr);
      va_end(arg_ptr);
      if (len < 0 || len >= (maxlen-5)) {
         *pool_buf = realloc_pool_memory(*pool_buf, maxlen + i + maxlen/2);
         continue;
      }
      break;
   }
   return len;
}
/*
 * Edit a message into a Pool memory buffer, with file:lineno
 */
Edit a message into a Pool memory buffer, with file:lineno
Edit a message into a Pool memory buffer with file : lineno
int m_msg(const char *file, int line, POOLMEM **pool_buf, const char *fmt, ...)
{
   va_list   arg_ptr;
   int i, len, maxlen;
   i = sprintf(*pool_buf, "%s:%d ", get_basename(file), line);
   for (;;) {
      maxlen = sizeof_pool_memory(*pool_buf) - i - 1;
      va_start(arg_ptr, fmt);
      len = bvsnprintf(*pool_buf+i, maxlen, fmt, arg_ptr);
      va_end(arg_ptr);
      if (len < 0 || len >= (maxlen-5)) {
         *pool_buf = realloc_pool_memory(*pool_buf, maxlen + i + maxlen/2);
         continue;
      }
      break;
   }
   return len;
}
int m_msg ( const char * file , int line , POOLMEM * * pool_buf , const char * fmt , ... ) { va_list arg_ptr ; int i , len , maxlen ; i = sprintf ( * pool_buf , " " , get_basename ( file ) , line ) ; for ( ; ; ) { maxlen = sizeof_pool_memory ( * pool_buf ) - i - 1 ; va_start ( arg_ptr , fmt ) ; len = bvsnprintf ( * pool_buf + i , maxlen , fmt , arg_ptr ) ; va_end ( arg_ptr ) ; if ( len < 0 || len >= ( maxlen - 5 ) ) { * pool_buf = realloc_pool_memory ( * pool_buf , maxlen + i + maxlen / 2 ) ; continue ; } break ; } return len ; }
Edit a message into a Pool memory buffer, with file:lineno
Edit a message into a Pool memory buffer with file : lineno