title: Sprintf() error
body: <p>There is a <code>Binary2String()</code> in my project. </p>
  
  <p>It works well for a long time. But it threw exception when <code>vec[0] = 255</code> on <code>sprintf(temp, "%02d ", vec[i]);</code>.</p>
  
  <p>Original Code as this,</p>
  
  <pre><code>void Binary2String(const vector&lt;unsigned char&gt;&amp; vec, string&amp; result)
  {
  
   if(vec.size() == 0)
    return;
  
   for(size_t i = 0; i &lt; vec.size(); i++)
   {
    char temp[4] = {0};
    sprintf(temp, "%02d ", vec[i]);
    result.push_back(temp[0]);
    result.push_back(temp[1]);
    result.push_back(temp[2]);
  
   }
  }
  </code></pre>
  
  <p>Then I fixed the bug as this, I can't understand the vector and sprintf() completed. </p>
  
  <p>Does it make sense or not? (I am new to C++. Thank you)</p>
  
  <pre><code>        char temp[6] = {0};
    sprintf(temp, "%02d ", vec[i]);
    result.push_back(temp[0]);
    result.push_back(temp[1]);
    result.push_back(temp[2]);
          result.push_back(temp[3]);
    result.push_back(temp[4]);
  </code></pre>