1

I need help regarding to this message:

input_login.cpp:247: warning: comparison with string literal results in unspecified behaviour

Line is :

if (row[maxcols] != "PLAYER")

Can somone explain what this error means? First i was thinking is the variable on maxcols so i put DWORD but is not right.

Code is:

if (gm)
{
    char szQuery1[QUERY_MAX_LEN];
    snprintf(szQuery1, sizeof(szQuery1),"SELECT mAuthority FROM __sv1_common.gmlist WHERE mAccount = '%s'", login);
    std::auto_ptr<SQLMsg> pMsg3(DBManager::instance().DirectQuery(szQuery1));
    int maxcols = pMsg3->Get()->uiNumRows;
    if (pMsg3->Get()->uiNumRows >= 1)
    {
        MYSQL_ROW row = NULL;
        while ((row = mysql_fetch_row(pMsg3->Get()->pSQLResult)))
        {
            if (row[maxcols] != "PLAYER")
            {
                allowed_to_login = true;
                break;
            }
            maxcols--;
        }
    }
}

0 Answers0