Código:
#include <stdio.h>
#include <string.h>
void pickposition(char * position) {
  printf("\nChoose a position (Ex.: B2, A0, etc): ");
  scanf(" %2s", position);
}
void printtable(char table[3][3]) {
  printf("\n\n");
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
        char c = table[i][j];
        if (c != 'O' && c != 'X') {
            table[i][j] = '_';
        }
    }
  }
  printf("   A   B   C \n");
  printf("0 _%c_|_%c_|_%c_\n", table[0][0], table[0][1], table[0][2]);
  printf("1 _%c_|_%c_|_%c_\n", table[1][0], table[1][1], table[1][2]);
  printf("2 _%c_|_%c_|_%c_\n", table[2][0], table[2][1], table[2][2]);
  printf("\n\n");
}
void pickusername(char *name) {
  printf("\nType your username (20 characters): ");
  scanf("%20s", name);
}
int main() {
  printf("\nStarting...\n");
  char table[3][3];
  char player1[20];
  char player2[20];
  pickusername(player1);
  pickusername(player2);
  int next = 1;
  int counter = 0;
  while (1) {
    char nextname[20];
    printtable(table);
    if (next) {
        strcpy(nextname, player1);
    } else {
        strcpy(nextname, player2);
    }
    printf("It's your turn, %s!\n", nextname);
    char positionpicked[2];
    pickposition(positionpicked);
    printf("\nPicked: %s\n", positionpicked);
    counter--;
    if (counter == -20) {
        break;
    }
  }
}Eu estou fazendo um jogo da velha em C, mas estou tendo um problema.Guardo os nomes dos jogadores em 2 arrays de char, para mostrar a mensagem "É a sua vez, %s!".O problema é que após passar pela linha 56, na próxima vez que imprimo o nome desse jogador, sai em branco. Ex.: "É a sua vez, !".
Se eu comento a linha 56, o problema some.