- char *data = NULL;
- ln = _vscprintf(fmt, va);
- data = malloc(ln + 1);
- data[ln] = 0;
- vsprintf(data, fmt, va);
- if (GMQCC_IS_DEFINE(handle))
- ln = win_fputs(data, handle);
- else
- ln = fputs(data, handle);
- free(data);
+ char data[4096];
+ memset(data, 0, sizeof(data));
+ vsnprintf(data, sizeof(data), fmt, va);
+ ln = (GMQCC_IS_DEFINE(handle)) ? win_fputs(handle, data) : file_puts(handle, data);