title: C - conditional jump (valgrind)
body: <p>I don't understand condtional jump with valgrind, I made this little function but even if it-s small, there is this condtional jump</p>
  
  <p>here's the function :</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  char    *function(char *str)
  {
    int   i = 0;
    int   a = 0;
    char  *cpy;
  
    cpy = malloc(100);
    while (str[i] != '\0')
      {
        if (str[i] == 'a')
          cpy[a++] = 'b';
        i++;
      }
    return (cpy);
  }
  
  int     main(int ac, char **av)
  {
    char  *str;
  
    str = function(av[1]);
    printf("%s\n", str);
  }
  </code></pre>
  
  <p>When i'm using valgrind like this</p>
  
  <pre><code>valgrind ./a.out "aa aa aaaaaaaaaaa"
  </code></pre>
  
  <p>it gives me 1 error</p>
  
  <pre><code>==3397== Conditional jump or move depends on uninitialised value(s)
  ==3397==    at 0x4C2E4E8: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==3397==    by 0x4EA1531: puts (in /lib64/libc-2.24.so)
  ==3397==    by 0x400609: main (in /home/benoit.pingris/train/a.out)
  </code></pre>
  
  <p>What does it mean ?
  Thanks.</p>