Uint8 c;
void send_to_server (unsigned char *str, int len) {  static int nerr = 0;  unsigned char msg[1024];  if (len >= 1024-2) {    log_error ("Cannot send message to server: too long\n");    exit (9);  }  msg[0] = str[0];  *((short *) (msg+1)) = (Uint16) len;  memcpy (msg+3, str+1, len-1);  if (SDLNet_TCP_Send (thesock, msg, len+2) < len+2) {    log_error ("When sending message to server: %s\n",              SDLNet_GetError ());    if (++nerr > MAX_NERR) {      log_error ("This has happened too many times, giving up...\n");      exit (8);    }  }}