If what you are parsing here is indeed corrupted, you may end up in an
endless loop with p not moving anymore. You have to advance 'p' at least
by 1 and have a check before whether *p == '\0' to get out of it. You
may also want to put this check before the calculation of 'next'.

When the execution gets to a 'continue', the do..while loop will resume
execution from next iteration after processing the conditional check. In
this case, whe condition in 'while' loop is :