Be careful of the scoping of variables declared inside for() statements.
This commit is contained in:
timeless%mozdev.org 2004-10-25 05:51:24 +00:00
Родитель bc10b9ad7a
Коммит 0cdccd40c7
2 изменённых файлов: 4 добавлений и 2 удалений

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

@ -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])
{ {