]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/client.c
Remove CLIENT.oper_by_my, Client_SetOperByMe() and Client_OperByMe()
[ngircd-alex.git] / src / ngircd / client.c
index 2835b46f51f7bc6d19e59894f5bb43d8cef4cfcd..b1a371fc4e156e683141ab207607bd458fcfe799 100644 (file)
@@ -221,7 +221,7 @@ Init_New_Client(CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer,
                Generate_MyToken(client);
 
        if (Client_HasMode(client, 'a'))
-               strlcpy(client->away, DEFAULT_AWAY_MSG, sizeof(client->away));
+               client->away = strndup(DEFAULT_AWAY_MSG, CLIENT_AWAY_LEN - 1);
 
        client->next = (POINTER *)My_Clients;
        My_Clients = client;
@@ -500,7 +500,11 @@ Client_SetAway( CLIENT *Client, const char *Txt )
        assert( Client != NULL );
        assert( Txt != NULL );
 
-       strlcpy( Client->away, Txt, sizeof( Client->away ));
+       if (Client->away)
+               free(Client->away);
+
+       Client->away = strndup(Txt, CLIENT_AWAY_LEN - 1);
+
        LogDebug("%s \"%s\" is away: %s", Client_TypeText(Client),
                 Client_Mask(Client), Txt);
 } /* Client_SetAway */
@@ -541,14 +545,6 @@ Client_SetIntroducer( CLIENT *Client, CLIENT *Introducer )
 } /* Client_SetIntroducer */
 
 
-GLOBAL void
-Client_SetOperByMe( CLIENT *Client, bool OperByMe )
-{
-       assert( Client != NULL );
-       Client->oper_by_me = OperByMe;
-} /* Client_SetOperByMe */
-
-
 GLOBAL bool
 Client_ModeAdd( CLIENT *Client, char Mode )
 {
@@ -885,14 +881,6 @@ Client_Flags( CLIENT *Client )
 } /* Client_Flags */
 
 
-GLOBAL bool
-Client_OperByMe( CLIENT *Client )
-{
-       assert( Client != NULL );
-       return Client->oper_by_me;
-} /* Client_OperByMe */
-
-
 GLOBAL int
 Client_Hops( CLIENT *Client )
 {
@@ -1422,7 +1410,6 @@ New_Client_Struct( void )
 
        c->type = CLIENT_UNKNOWN;
        c->conn_id = NONE;
-       c->oper_by_me = false;
        c->hops = -1;
        c->token = -1;
        c->mytoken = -1;
@@ -1441,6 +1428,8 @@ Free_Client(CLIENT **Client)
 
        if ((*Client)->account_name)
                free((*Client)->account_name);
+       if ((*Client)->away)
+               free((*Client)->away);
        if ((*Client)->cloaked)
                free((*Client)->cloaked);
        if ((*Client)->ipa_text)