From 3558e5d49d8560fe7a09ef2034c10615b83974f9 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 4 Jun 2014 00:21:35 +0200 Subject: [PATCH] service: constify struct service fields Signed-off-by: Felix Fietkau --- service.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/service.c b/service.c index 049de52..9eb620e 100644 --- a/service.c +++ b/service.c @@ -46,8 +46,8 @@ struct service { time_t t; - char *service; - char *daemon; + const char *service; + const char *daemon; const uint8_t *txt; int txt_len; int port; @@ -94,7 +94,7 @@ service_send_ptr(struct uloop_fd *u, struct service *s) } static void -service_send_ptr_c(struct uloop_fd *u, char *host) +service_send_ptr_c(struct uloop_fd *u, const char *host) { unsigned char buffer[MAX_NAME_LEN]; int len = dn_comp(host, buffer, MAX_NAME_LEN, NULL, NULL); @@ -280,10 +280,8 @@ service_load(char *path) continue; s->port = blobmsg_get_u32(_tb[SERVICE_PORT]); - s->service = d_service; - s->daemon = d_daemon; - strcpy(s->service, blobmsg_name(cur)); - strcpy(s->daemon, gl.gl_pathv[i]); + s->service = strcpy(d_service, blobmsg_name(cur)); + s->daemon = strcpy(d_daemon, gl.gl_pathv[i]); s->avl.key = s->service; s->active = 1; s->t = 0; -- 2.30.2