1
0
mirror of https://github.com/irssi/irssi.git synced 2024-07-21 03:14:16 -04:00

Merge pull request #1315 from pekdon/otr_g_strndup

Use g_strndup, strndup is not available on old platforms
This commit is contained in:
ailin-nemui 2021-05-17 14:43:31 +02:00 committed by GitHub
commit 58c9aecf86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -643,7 +643,7 @@ static enum otr_msg_status enqueue_otr_fragment(const char *msg, struct otr_peer
* Dup the string with enough space for the NULL byte since we are
* about to free it before passing it to the caller.
*/
*full_msg = strndup(opc->full_msg, opc->msg_len + 1);
*full_msg = g_strndup(opc->full_msg, opc->msg_len + 1);
/* Reset everything. */
free(opc->full_msg);
opc->full_msg = NULL;