]> git.cworth.org Git - loudgame/blobdiff - lg-loa.c
Fix segfault when formatting "Illegal move" message.
[loudgame] / lg-loa.c
index f6a8f4c182e10811b093ed1bf5651fe09779463f..a1949d3b8af20b640328da449c486ed82f0dd58c 100644 (file)
--- a/lg-loa.c
+++ b/lg-loa.c
@@ -412,7 +412,9 @@ loa_game_move (loa_game_t *game, const char * peer,
     }
 
     if (! board_move_legal (&game->board, x1, y1, x2, y2, &error)) {
-       loudgame_sendf (&game->lg, peer, "Illegal move: %s.");
+       loudgame_sendf (&game->lg, peer, "Illegal move: %c%d%c%d",
+                       'a' + x1, BOARD_SIZE - y1,
+                       'a' + x2, BOARD_SIZE - y2);
        return FALSE;
     }