title: Array of buffer always changing values
body: <p>I have this code for verify what's in the array buffer, but i'm always getting different values on array and it makes my program getting a 56( 8 on ascii) when its not supose too, can somebody helps ? </p>
  
  <p>This sends a buffer for socket to be read on file 1:</p>
  
  <pre><code>          void send_stream(char buff[], int sockfdes)
          {
              if (write(sockfdes, buff, strlen(buff) + 1) == -1) {
          perror("ERROR: envia_stream: simulador");
                      }    
           }
  
          void prepare_message(int tipo, int id)
             { 
            char buff[3];
  
           buff[1] = id;
  
         switch (tipo)
       {
       case CRIACAO_P:
       buff[0] = '1';
       //buff[2] = tempo; //HORA
       send_stream(buff, sockfd);
       break;
        }
  </code></pre>
  
  <p>this file 2 read from socket and put in buffer:</p>
  
  <pre><code>  char buffer[5];    
     while(1) 
      {
  
          read(novosockfd, buffer, sizeof(buffer));
  
                  if (buffer[0] == '8')//FIM
          {
                       printf("Buffer[0]: %d \n", buffer[0]);
                       printf("Buffer[1]: %d \n", buffer[1]);
                       printf("Buffer[2]: %d \n", buffer[2]);
                       printf("Buffer[3]: %d \n", buffer[3]);
                       printf("Buffer[4]: %d \n", buffer[4]); 
  
  
              printf("\nSimulação terminou\n");
              break;
          }
  
         }
           }
  </code></pre>