[Vortex] Problem when calling vortex_connection_close

Robert M. Münch robert.muench at robertmuench.de
Sat May 3 08:52:40 CEST 2008


On Wed, 30 Apr 2008 18:22:21 +0200, Sam Roberts <vieuxtech at gmail.com>  
wrote:

>>  void odprintf(const char *format, ...){
>                                     ^ shouldn't this be "va_list args"?

Hi, hmm... good point. But if I specify a va_list argument is it still  
possible to call odprintf(...) with arbitrary long parameter list? Or is  
it than required to provide a va_list argument? I re-use this function in  
the vortex sense but use it for my own debugging messages as well.

>>  char    buf[4096], *p = buf;
>>  va_list args;
> 	      ^  So this isn't needed?


>> int     n;
>> va_start(args, format);
>             ^ or this?

I'll give it a try. Maybe I need a special odprintf version with a va_list  
signature for vortex.

>> n = _vsnprintf(p, sizeof buf - 3, format, args); // buf-3 is room for   
>> CR/LF/NUL
>> va_end(args);
>     ^ or this

>> void xp_vortex_log(const char *domain, VortexDebugLevel log_level,  
>> const char *message, va_list args){
>>         odprintf(message, args);
>
> You are passing a va_list into the "..." here.
>
> That this works at all seems to be either lucky, or because of how MSVC  
> implements varargs.

Yes, and that's why it's throwing out strange content. Good catch. I'll  
take a look. Robert



More information about the Vortex mailing list