title: How to fill a string with random (hex) characters?
body: <p>I have a string (unsigned char) and i want to fill it with only hex characters.</p>
  
  <p>my code is</p>
  
  <pre><code>unsigned char str[STR_LEN] = {0};
  for(i = 0;i&lt;STR_LEN;i++) {
      sprintf(str[i],"%x",rand()%16);
  }
  </code></pre>
  
  <p>Of course, when running this I get segfaulted</p>