From df66050905c366a35cbae74c1b180e51e838722a Mon Sep 17 00:00:00 2001 From: Michael Ortmann <41313082+michaelortmann@users.noreply.github.com> Date: Sat, 6 Jul 2024 17:22:10 +0200 Subject: [PATCH] Change strncpyz define to strlcpy --- src/mod/module.h | 10 +++++----- src/modules.c | 4 +--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/mod/module.h b/src/mod/module.h index 9f84411ea..efab4174f 100644 --- a/src/mod/module.h +++ b/src/mod/module.h @@ -202,7 +202,7 @@ typedef void (*chanout_butfunc)(int, int, const char *, ...) ATTRIBUTE_FORMAT(pr #define open_telnet ((int (*) (int, char *, int))global[87]) /* 88 - 91 */ #define check_tcl_event ((void (*) (const char *))global[88]) -/* was my_memcpy -- use memcpy() instead */ +/* was my_memcpy() -- use memcpy() instead */ #define my_atoul ((IP(*)(char *))global[90]) #define my_strcpy ((int (*)(char *, const char *))global[91]) /* 92 - 95 */ @@ -426,10 +426,10 @@ typedef void (*chanout_butfunc)(int, int, const char *, ...) ATTRIBUTE_FORMAT(pr /* 252 - 255 */ #define egg_snprintf (global[252]) #define egg_vsnprintf ((int (*)(char *, size_t, const char *, va_list))global[253]) -/* was egg_memset -- use memset() instead */ -/* was egg_strcasecmp -- use strcasecmp instead */ +/* was egg_memset() -- use memset() instead */ +/* was egg_strcasecmp() -- use strcasecmp() instead */ /* 256 - 259 */ -/* was egg_strncasecmp -- use strncasecmp instead */ +/* was egg_strncasecmp() -- use strncasecmp() instead */ #define is_file ((int (*)(const char *))global[257]) #define must_be_owner (*(int *)(global[258])) #define tandbot (*(tand_t **)(global[259])) @@ -497,7 +497,7 @@ typedef void (*chanout_butfunc)(int, int, const char *, ...) ATTRIBUTE_FORMAT(pr # define strlcpy ((size_t (*) (char *, const char *, size_t))global[303]) #endif /* 304 - 307 */ -#define strncpyz ((size_t (*) (char *, const char *, size_t))global[304]) +#define strncpyz strlcpy /* strncpyz() is deprecated, use strlcpy() instead */ #ifndef HAVE_BASE64 # define b64_ntop ((int (*) (uint8_t const *, size_t, char *, size_t))global[305]) # define b64_pton ((int (*) (const char *, uint8_t *, size_t))global[306]) diff --git a/src/modules.c b/src/modules.c index 1fd1dfb97..42b5953ee 100644 --- a/src/modules.c +++ b/src/modules.c @@ -64,8 +64,6 @@ # endif /* MOD_USE_DL */ #endif /* !STATIC */ -#define strncpyz strlcpy - extern struct dcc_t *dcc; extern struct userrec *userlist, *lastuser; extern struct chanset_t *chanset; @@ -591,7 +589,7 @@ Function global_table[] = { (Function) 0, #endif /* 304 - 307 */ - (Function) strncpyz, + (Function) strlcpy, /* was strncpyz() -- use strlcpy() instead */ #ifndef HAVE_BASE64 (Function) b64_ntop, (Function) b64_pton,