]> git.cworth.org Git - ttt/blobdiff - src/ttt-server.c
2005-12-09 Carl Worth <cworth@cworth.org>
[ttt] / src / ttt-server.c
index 4f647ee04f69c8b6e0044c325109cedd4b3b4ceb..cb28741885721763fd54abd4a8a83b270e07f442 100644 (file)
@@ -110,7 +110,7 @@ ttt_server_unregister_client (ttt_server_t *server, ttt_client_t *client)
 
     assert (i < server->num_clients);
 
 
     assert (i < server->num_clients);
 
-    printf ("Client %s has left.\r\n", ttt_client_get_username (client));
+    fprintf (stderr, "Client %s has left.\r\n", ttt_client_get_username (client));
 
     memmove (&server->clients[i], &server->clients[i+1],
             (server->num_clients - i - 1) * sizeof (ttt_client_t *));
 
     memmove (&server->clients[i], &server->clients[i+1],
             (server->num_clients - i - 1) * sizeof (ttt_client_t *));
@@ -328,10 +328,12 @@ main (int argc, char **argv)
 
     socket = ttt_socket_create_server (args.host, args.port);
 
 
     socket = ttt_socket_create_server (args.host, args.port);
 
-    if (args.detach)
+    if (args.detach) {
        printf ("Server started listening on %s:%s\n", args.host, args.port);
        printf ("Server started listening on %s:%s\n", args.host, args.port);
-    else
+       fprintf (stderr, "Server started listening on %s:%s\n", args.host, args.port);
+    } else {
        printf (WELCOME_MESSAGE, args.host, args.port, args.host, args.port);
        printf (WELCOME_MESSAGE, args.host, args.port, args.host, args.port);
+    }
 
     fclose (stdout);
     fclose (stdin);
 
     fclose (stdout);
     fclose (stdin);