warren's fix for the new/free mismatch undid kin's fix for the same problem. Also fix an off by one in the backwards 'for' loop. r=warren

git-svn-id: svn://10.0.0.236/trunk@78511 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jband%netscape.com
2000-09-08 09:36:35 +00:00
parent bd1dd0e2eb
commit c93adf1a1c
2 changed files with 4 additions and 4 deletions

View File

@@ -672,7 +672,7 @@ nsJARChannel::GetContentType(char* *aContentType)
if (fileName != nsnull) {
PRInt32 len = nsCRT::strlen(fileName);
const char* ext = nsnull;
for (PRInt32 i = len; i >= 0; i--) {
for (PRInt32 i = len-1; i >= 0; i--) {
if (fileName[i] == '.') {
ext = &fileName[i + 1];
break;
@@ -688,7 +688,7 @@ nsJARChannel::GetContentType(char* *aContentType)
else
rv = NS_ERROR_OUT_OF_MEMORY;
delete []fileName;
nsCRT::free(fileName);
}
else {
rv = NS_ERROR_FAILURE;

View File

@@ -672,7 +672,7 @@ nsJARChannel::GetContentType(char* *aContentType)
if (fileName != nsnull) {
PRInt32 len = nsCRT::strlen(fileName);
const char* ext = nsnull;
for (PRInt32 i = len; i >= 0; i--) {
for (PRInt32 i = len-1; i >= 0; i--) {
if (fileName[i] == '.') {
ext = &fileName[i + 1];
break;
@@ -688,7 +688,7 @@ nsJARChannel::GetContentType(char* *aContentType)
else
rv = NS_ERROR_OUT_OF_MEMORY;
delete []fileName;
nsCRT::free(fileName);
}
else {
rv = NS_ERROR_FAILURE;