title: understanding the pointer returned by strtok
body: <p>I have this code, where I tokenize a string and search for a value. </p>
  
  <pre><code>char string[]="Name=Marcus&amp;greeting=goodmorning";
  char* Name=parsePostData("Name",string);
  
  
  
  
  char* parsePostData(char s[],char t[])
  {
    char *pch;
    char *pp="Marcus";
  
    char tCpy[512];//Make a copy. Otherwise, strtok works on the char pointer, and original char array gets modified/ corrupted.
    strcpy(tCpy,t);
    pch = strtok (tCpy,"=&amp;");
    while (pch != NULL)
    {
        if(strcmp(pch,s)==0) {
              pch= strtok (NULL, "&amp;"); 
              //Case 1. what I need. but it is causing issues 
              //after I write to flash, and restart the board.
              return pch;   
  
              //Case 2. Forced test case. works perfect.             
              //return pp;
  
  
        }else{
          pch = strtok (NULL, "=&amp;");  
        }
    }
  
  }
  </code></pre>
  
  <p>what is the difference between the two cases inside the function?</p>