Add public mosquitto_strndup

This commit is contained in:
Roger A. Light
2023-09-20 21:48:55 +01:00
parent f2897c1a69
commit adc55572dc
4 changed files with 12 additions and 0 deletions

View File

@@ -570,6 +570,11 @@ mosq_EXPORT void *mosquitto_realloc(void *ptr, size_t size);
*/
mosq_EXPORT char *mosquitto_strdup(const char *s);
/*
* Function: mosquitto_strndup
*/
mosq_EXPORT char *mosquitto_strndup(const char *s, size_t n);
/* =========================================================================
*
* Section: Utility Functions

View File

@@ -67,6 +67,7 @@ _mosquitto_set_clientid
_mosquitto_set_username
_mosquitto_strdup
_mosquitto_string_to_property_info
_mosquitto_strndup
_mosquitto_sub_matches_acl
_mosquitto_sub_matches_acl_with_pattern
_mosquitto_sub_topic_check

View File

@@ -68,6 +68,7 @@
mosquitto_set_username;
mosquitto_strdup;
mosquitto_string_to_property_info;
mosquitto_strndup;
mosquitto_sub_matches_acl;
mosquitto_sub_matches_acl_with_pattern;
mosquitto_sub_topic_check2;

View File

@@ -44,3 +44,8 @@ BROKER_EXPORT char *mosquitto_strdup(const char *s)
{
return mosquitto__strdup(s);
}
BROKER_EXPORT char *mosquitto_strndup(const char *s, size_t n)
{
return mosquitto__strndup(s,n);
}