vsprintf crashes in Mach-O (Real Studio Plugins Mailinglist archive)

Back to the thread list
Previous thread: Trying to call a class event via a callback
Next thread: Accessing an integer value in class constructor is causing failed assertion


macosx and unix paths   -   GOLD
  vsprintf crashes in Mach-O   -   Alfred Van Hoek

vsprintf crashes in Mach-O
Date: 21.04.06 14:42 (Fri, 21 Apr 2006 09:42:25 -0400)
From: Alfred Van Hoek
The code below never failed, but currently in OSX-Carbon_MachO it
always crashes when a dlog string is produced like: dlog("%s %i",
"myPlugin message: err = ", status); where status is of type
OSStatus. Whether I would use CW-10 or Xcode, MSL or BSD,
respectively, the dylib crashes in vsprintf where it accesses
__formatter. Simple strings work fine...

void dlog(char *format, ...)
{
va_list args;
char buffer[255];

va_start(args,format);

strcpy(buffer + vsprintf(buffer,format,args), "");
Str255 dst;

CopyC2P(buffer, dst);

#ifndef WIN32
DebugStr(dst);
#else
OutputDebugString(buffer);
#endif
va_end(args);
}

Any other way to implement it? What is the mistake that now pops up?

Alfred

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>