title: Removing character from array using strchr, does not return right value in plain C
body: <p>I am trying to remove first semicolon from a character arrary whose value is:</p>
  
  <blockquote>
    <p>Input:  <br>; Test: 876033074,  808989746,  825766962, ; Test1:
    825766962,</p>
  </blockquote>
  
  <p>Code:  </p>
  
  <pre><code> char *cleaned = cleanResult(result);
              printf("Returned BY CLEAN: %s\n",cleaned);
  
  
  
      char *cleanResult(char *in)
      {   
          printf("Cleaning this: %s\n",in);
  
          char *firstOccur = strchr(in,';');
          printf("CLEAN To Remove: %s\n",firstOccur);
          char *restOfArray = firstOccur + 2;
          printf("CLEAN To Remove: %s\n",restOfArray); //Correct Value Printed here
  
          char *toRemove;
          while ((toRemove = strstr(restOfArray + 2,", ;"))!=NULL) 
          {
              printf("To Remove: %s\n",toRemove);
              memmove (toRemove, toRemove + 2, strlen(toRemove + 2));
              printf("Removed: %s\n",toRemove); //Correct Value Printed
          }
  
          return in;
      }
  </code></pre>
  
  <blockquote>
    <p>Output (first semicolon still there):  <br>; Test: 876033074, 
    808989746,  825766962; Test1: 825766962;</p>
  </blockquote>