From 1d307e554df36da86ae959a1e1030aa6ccd02c5d Mon Sep 17 00:00:00 2001 From: "sayrer%gmail.com" Date: Mon, 19 Feb 2007 00:19:43 +0000 Subject: [PATCH] Bug 367779. followup snprintf fixes. patch by Ryan Jones . r+sr=brendan --- js/src/xpconnect/src/nsXPConnect.cpp | 14 +++++++------- js/src/xpconnect/src/xpcwrappedjs.cpp | 4 ++-- js/src/xpconnect/src/xpcwrappednative.cpp | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/js/src/xpconnect/src/nsXPConnect.cpp b/js/src/xpconnect/src/nsXPConnect.cpp index 70c518d67c7..a48072ee3c9 100644 --- a/js/src/xpconnect/src/nsXPConnect.cpp +++ b/js/src/xpconnect/src/nsXPConnect.cpp @@ -596,10 +596,10 @@ nsXPConnect::Traverse(void *p, nsCycleCollectionTraversalCallback &cb) XPCWrappedNative* wn = XPCNativeWrapper::GetWrappedNative(cx, obj); XPCNativeScriptableInfo* si = wn ? wn->GetScriptableInfo() : nsnull; if(si) - snprintf(name, sizeof(name), "XPCNativeWrapper (%s)", - si->GetJSClass()->name); + JS_snprintf(name, sizeof(name), "XPCNativeWrapper (%s)", + si->GetJSClass()->name); else - snprintf(name, sizeof(name), "XPCNativeWrapper"); + JS_snprintf(name, sizeof(name), "XPCNativeWrapper"); } else if(obj) { @@ -611,14 +611,14 @@ nsXPConnect::Traverse(void *p, nsCycleCollectionTraversalCallback &cb) si = p->GetScriptableInfo(); } if(si) - snprintf(name, sizeof(name), "JS Object (%s - %s)", clazz->name, - si->GetJSClass()->name); + JS_snprintf(name, sizeof(name), "JS Object (%s - %s)", clazz->name, + si->GetJSClass()->name); else - snprintf(name, sizeof(name), "JS Object (%s)", clazz->name); + JS_snprintf(name, sizeof(name), "JS Object (%s)", clazz->name); } else { - snprintf(name, sizeof(name), "JS Object"); + JS_snprintf(name, sizeof(name), "JS Object"); } cb.DescribeNode(refcount, sizeof(JSObject), name); #else diff --git a/js/src/xpconnect/src/xpcwrappedjs.cpp b/js/src/xpconnect/src/xpcwrappedjs.cpp index b98d506a6a1..fee0b5faf77 100644 --- a/js/src/xpconnect/src/xpcwrappedjs.cpp +++ b/js/src/xpconnect/src/xpcwrappedjs.cpp @@ -83,8 +83,8 @@ NS_CYCLE_COLLECTION_CLASSNAME(nsXPCWrappedJS)::Traverse nsrefcnt refcnt = tmp->mRefCnt.get(); #ifdef DEBUG char name[72]; - snprintf(name, sizeof(name), "nsXPCWrappedJS (%s)", - tmp->GetClass()->GetInterfaceName()); + JS_snprintf(name, sizeof(name), "nsXPCWrappedJS (%s)", + tmp->GetClass()->GetInterfaceName()); cb.DescribeNode(refcnt, sizeof(nsXPCWrappedJS), name); #else cb.DescribeNode(refcnt, sizeof(nsXPCWrappedJS), "nsXPCWrappedJS"); diff --git a/js/src/xpconnect/src/xpcwrappednative.cpp b/js/src/xpconnect/src/xpcwrappednative.cpp index c7668575660..bc48097c1fa 100644 --- a/js/src/xpconnect/src/xpcwrappednative.cpp +++ b/js/src/xpconnect/src/xpcwrappednative.cpp @@ -61,10 +61,10 @@ NS_CYCLE_COLLECTION_CLASSNAME(XPCWrappedNative)::Traverse(nsISupports *s, char name[72]; XPCNativeScriptableInfo* si = tmp->GetScriptableInfo(); if(si) - snprintf(name, sizeof(name), "XPCWrappedNative (%s)", - si->GetJSClass()->name); + JS_snprintf(name, sizeof(name), "XPCWrappedNative (%s)", + si->GetJSClass()->name); else - snprintf(name, sizeof(name), "XPCWrappedNative"); + JS_snprintf(name, sizeof(name), "XPCWrappedNative"); cb.DescribeNode(tmp->mRefCnt.get(), sizeof(XPCWrappedNative), name); #else