Fixed dprintf as suggested by Patrick Beard (beard@netscape.com).

Now dprintf calls PR_vsnprintf instead of PR_vsmprintf, so that
dprintf does not allocate memory.  This is because PR_Assert (which
calls dprintf) can get called at interrupt time, and it is unsafe
to allocate memory at interrupt time on the Mac.
This commit is contained in:
wtc%netscape.com 1998-09-09 01:17:41 +00:00
parent 7dfc458faf
commit faf263bb06

View File

@ -482,15 +482,13 @@ void dprintf(const char *format, ...)
{
#if DEBUG
va_list ap;
char *buffer;
Str255 buffer;
va_start(ap, format);
buffer = PR_vsmprintf(format, ap);
buffer[0] = PR_vsnprintf((char *)buffer + 1, sizeof(buffer) - 1, format, ap);
va_end(ap);
c2pstr(buffer);
DebugStr( (unsigned char *)buffer);
free(buffer);
DebugStr(buffer);
#endif /* DEBUG */
}