title: C printing a void * buffer
body: <p>kay so this </p>
  
  <pre><code>void printPacketBuffer(void *buffer, unsigned int length)
  {
      unsigned int i=0;
      char *c;
      unsigned int limit = ( (length != 0)?length:PACKET_DATA );
      for (i=0; i&lt;limit; i++) {
          c = (char *)(buffer+i);
          if ( *c != '\0' ) {
              printf("%c", *c);
          }
      }
  }
  </code></pre>
  
  <p>is working but the following function short miss the last 14 bytes can't understand why ?! </p>
  
  <pre><code>void printPacket (void * buffer) {
      unsigned int size = getPacket_size(buffer);
      printf("\n***********\nNew Packet holding %d bytes of data\n***********\n", size);
      char *c;
      int counter=0;
      int i;
      for (i=2; i&lt;size+2; i++) {
          c = (char *)(buffer+i);
          if ( *c != '\0' ) {
              printf("%c", *c);
              counter++;
          }
      }
      printf("\nactual printing %d, i=%d\n", counter, i);
  }
  </code></pre>
  
  <p>and here is the calls </p>
  
  <pre><code>printPacketBuffer(pbuffer+2, getPacket_size(pbuffer));
  printPacket(pbuffer);
  </code></pre>