lpcware

strstr

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by renan on Thu Sep 16 04:21:14 MST 2010
I've been having problem with strstr. It get stuck (or take too long) in a loop that tests the contents of a vector. This is part of my code:


    for (loop = 0; loop < ROOT_DIR_SIZE; loop++)
    {
        if (strstr ((const char *)buffer, (const char *)dev) != NULL)
        {
            device = TRUE;
            break;
        }
        loop++;
    }


It is a simple code, ROOT_DIR_SIZE is 512! So it isn't that big.
Any help?

Thanks,
Renan

Outcomes