Bug 552951 followup - Avoid the use of goto; r=mayhemer

This commit is contained in:
Kai engert 2011-03-28 00:05:04 -04:00
Родитель 4854227de8
Коммит 0abdca9b13
1 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -565,18 +565,21 @@ nsKeygenFormProcessor::GetPublicKey(nsAString& aValue, nsAString& aChallenge,
if (strcmp(keyparamsString, "null") == 0) if (strcmp(keyparamsString, "null") == 0)
goto loser; goto loser;
str = keyparamsString; str = keyparamsString;
PRBool found_match = PR_FALSE;
do { do {
end = strchr(str, ','); end = strchr(str, ',');
if (end != nsnull) if (end != nsnull)
*end = '\0'; *end = '\0';
primeBits = pqg_prime_bits(str); primeBits = pqg_prime_bits(str);
if (keysize == primeBits) if (keysize == primeBits) {
goto found_match; found_match = PR_TRUE;
break;
}
str = end + 1; str = end + 1;
} while (end != nsnull); } while (end != nsnull);
goto loser; if (!found_match) {
found_match: goto loser;
(void)0; }
} else if (aKeyType.LowerCaseEqualsLiteral("ec")) { } else if (aKeyType.LowerCaseEqualsLiteral("ec")) {
keyparamsString = ToNewCString(aKeyParams); keyparamsString = ToNewCString(aKeyParams);
if (!keyparamsString) { if (!keyparamsString) {