+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 ", 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;
+}
+
+