зеркало из https://github.com/mozilla/gecko-dev.git
Be careful of the scoping of variables declared inside for() statements.
This commit is contained in:
Родитель
bc10b9ad7a
Коммит
0cdccd40c7
|
@ -121,7 +121,8 @@ void CMostRecentUrls::AddURL(const char * aURL)
|
||||||
strcpy(szTemp, aURL);
|
strcpy(szTemp, aURL);
|
||||||
|
|
||||||
// check to see if an existing url matches the one passed in
|
// check to see if an existing url matches the one passed in
|
||||||
for (int i=0; i<MAX_URLS-1; i++)
|
int i = 0;
|
||||||
|
for (; i<MAX_URLS-1; i++)
|
||||||
{
|
{
|
||||||
if(mURLs[i])
|
if(mURLs[i])
|
||||||
{
|
{
|
||||||
|
|
|
@ -115,7 +115,8 @@ void CMostRecentUrls::AddURL(const char * aURL)
|
||||||
szTemp[sizeof(szTemp) - 1] = '\0';
|
szTemp[sizeof(szTemp) - 1] = '\0';
|
||||||
|
|
||||||
// check to see if an existing url matches the one passed in
|
// check to see if an existing url matches the one passed in
|
||||||
for (int i=0; i<MAX_URLS-1; i++)
|
int i = 0;
|
||||||
|
for (; i<MAX_URLS-1; i++)
|
||||||
{
|
{
|
||||||
if(mURLs[i])
|
if(mURLs[i])
|
||||||
{
|
{
|
||||||
|
|
Загрузка…
Ссылка в новой задаче