diff options
author | wtc%netscape.com <devnull@localhost> | 1998-09-09 01:17:41 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 1998-09-09 01:17:41 +0000 |
commit | 3e3a7bafc0a96e5929d66d73a78bdfcca0c79318 (patch) | |
tree | ead0b85cbb6f62c5ef60f220e01b92b2072fba1e | |
parent | 879f176d544e99a67c1d2ab2ccdd85582d5f88c9 (diff) | |
download | nspr-hg-3e3a7bafc0a96e5929d66d73a78bdfcca0c79318.tar.gz |
Fixed dprintf as suggested by Patrick Beard (beard@netscape.com).PROGRESS_19980909_BASE
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.
-rw-r--r-- | pr/src/md/mac/mdmac.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/pr/src/md/mac/mdmac.c b/pr/src/md/mac/mdmac.c index 510d9b17..1b5d2e7a 100644 --- a/pr/src/md/mac/mdmac.c +++ b/pr/src/md/mac/mdmac.c @@ -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 */ } |