X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fclient.c;h=b1a371fc4e156e683141ab207607bd458fcfe799;hp=2835b46f51f7bc6d19e59894f5bb43d8cef4cfcd;hb=b5faf3055b61afaef73ac49a448cac1a5b063127;hpb=0ff33777febca1ac06417c976a4a3e76b68c93d8 diff --git a/src/ngircd/client.c b/src/ngircd/client.c index 2835b46f..b1a371fc 100644 --- a/src/ngircd/client.c +++ b/src/ngircd/client.c @@ -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)