1
0
mirror of https://github.com/osmarks/ngircd.git synced 2024-10-27 20:36:18 +00:00

Silence compiler warning in Init_New_Client()

Use strdup() instead of pointless strndup() to fix the following
compiler warning:

client.c: In function ‘Init_New_Client’:
client.c:216:32: warning: ‘strndup’ specified bound 127 exceeds source size 5 [-Wstringop-overread]
  216 |                 client->away = strndup(DEFAULT_AWAY_MSG, CLIENT_AWAY_LEN - 1);
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
Alexander Barton 2023-09-17 20:16:35 +02:00
parent 30ba325dde
commit 232c7382de

View File

@ -213,7 +213,7 @@ Init_New_Client(CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer,
Generate_MyToken(client); Generate_MyToken(client);
if (Client_HasMode(client, 'a')) if (Client_HasMode(client, 'a'))
client->away = strndup(DEFAULT_AWAY_MSG, CLIENT_AWAY_LEN - 1); client->away = strdup(DEFAULT_AWAY_MSG);
client->next = (POINTER *)My_Clients; client->next = (POINTER *)My_Clients;
My_Clients = client; My_Clients = client;