From ddf0252fa5bc57af0eaef31767a7315b4757132a Mon Sep 17 00:00:00 2001 From: "valeski%netscape.com" Date: Wed, 7 Jul 1999 14:47:19 +0000 Subject: [PATCH] getbuffer to tonewcstring change --- profile/pref-migrator/src/nsPrefMigrationProgressDialog.cpp | 4 +++- silentdl/nsSilentDownload.cpp | 4 +++- webshell/embed/gtk/lib/GtkMozillaContainer.cpp | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/profile/pref-migrator/src/nsPrefMigrationProgressDialog.cpp b/profile/pref-migrator/src/nsPrefMigrationProgressDialog.cpp index 257bd71a6695..25832c1121b2 100644 --- a/profile/pref-migrator/src/nsPrefMigrationProgressDialog.cpp +++ b/profile/pref-migrator/src/nsPrefMigrationProgressDialog.cpp @@ -188,8 +188,10 @@ nsPrefMigrationProgressDialog::CreateProfileProgressDialog() } nsIURI *uri = nsnull; - const char *uriStr = urlString.GetBuffer(); + char *uriStr = urlString.ToNewCString(); + if (!uriStr) return NS_ERROR_OUT_OF_MEMORY; rv = service->NewURI(urlString, nsnull, &uri); + nsCRT::free(uriStr); if (NS_FAILED(rv)) { DEBUG_PRINTF(PR_STDOUT, "cannot get uri\n"); return NS_OK; diff --git a/silentdl/nsSilentDownload.cpp b/silentdl/nsSilentDownload.cpp index c86b743391a8..370763d190d5 100644 --- a/silentdl/nsSilentDownload.cpp +++ b/silentdl/nsSilentDownload.cpp @@ -856,8 +856,10 @@ nsSilentDownloadTask::DownloadSelf(PRInt32 range) if (NS_FAILED(result)) return result; nsIURI *uri = nsnull; - const char *uriStr = mUrl.GetBuffer(); + char *uriStr = mUrl.ToNewCString(); + if (!uriStr) return NS_ERROR_OUT_OF_MEMORY; result = service->NewURI(uriStr, nsnull, &uri); + nsCRT::free(uriStr); if (NS_FAILED(result)) return result; result = uri->QueryInterface(nsIURI::GetIID(), (void**)&pURL); diff --git a/webshell/embed/gtk/lib/GtkMozillaContainer.cpp b/webshell/embed/gtk/lib/GtkMozillaContainer.cpp index 8316fcd80c90..d885b07df028 100644 --- a/webshell/embed/gtk/lib/GtkMozillaContainer.cpp +++ b/webshell/embed/gtk/lib/GtkMozillaContainer.cpp @@ -416,8 +416,10 @@ GtkMozillaContainer::StartStream(const char *base_url, const char *action, if (NS_FAILED(rv)) return rv; nsIURI *uri = nsnull; - const char *uriStr = url_str.GetBuffer(); + char *uriStr = url_str.ToNewCString(); + if (!uriStr) return NS_ERROR_OUT_OF_MEMORY; rv = service->NewURI(uriStr, nsnull, &uri); + nsCRT::uriStr); if (NS_FAILED(rv)) return rv; rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);