Skip to content

Commit 714cbd8

Browse files
AlexFabrehenrikbrixandersen
authored andcommitted
log: backend: net: add const qualifier to hostname
When setting the net log hostname, the string content is not modified. Signed-off-by: Alex Fabre <[email protected]>
1 parent 2299f9a commit 714cbd8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/zephyr/logging/log_backend_net.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ bool log_backend_net_set_ip(const struct sockaddr *addr);
6565
* @param len Length of the hostname array.
6666
*/
6767
#if defined(CONFIG_NET_HOSTNAME_ENABLE)
68-
void log_backend_net_hostname_set(char *hostname, size_t len);
68+
void log_backend_net_hostname_set(const char *hostname, size_t len);
6969
#else
7070
static inline void log_backend_net_hostname_set(const char *hostname, size_t len)
7171
{

subsys/logging/backends/log_backend_net.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ bool log_backend_net_set_ip(const struct sockaddr *addr)
295295
}
296296

297297
#if defined(CONFIG_NET_HOSTNAME_ENABLE)
298-
void log_backend_net_hostname_set(char *hostname, size_t len)
298+
void log_backend_net_hostname_set(const char *hostname, size_t len)
299299
{
300300
(void)strncpy(dev_hostname, hostname, MIN(len, MAX_HOSTNAME_LEN));
301301
log_output_hostname_set(&log_output_net, dev_hostname);

0 commit comments

Comments
 (0)