title: weird chars at the end of char array
body: <p>what i want to do is to read the chars from a buffer array</p>
  
  <pre><code>std::vector&lt;char&gt; SmartIO::PeekChar(){
          int newlen= 0;
          while(buffer[ptrSeek] != 0){
              ptrSeek++;
              newlen++;
          }
  
          std::vector&lt;char&gt; temp(newlen);
          memcpy(temp.data(),&amp;buffer[ptrSeek-newlen],newlen);
          ptrSeek = 0;
          return temp;
  }
  </code></pre>
  
  <p>so <code>temp.data()</code> returns for an e.g <code>methodtest‎‎‎‎««««««««î‏</code> while the result should be <code>methodtest</code> only!
  so what is causing this weird chars?</p>