util: constify memdup()
authorFelix Fietkau <nbd@openwrt.org>
Tue, 3 Jun 2014 21:44:00 +0000 (23:44 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 3 Jun 2014 21:44:00 +0000 (23:44 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
util.c
util.h

diff --git a/util.c b/util.c
index 1708a40..4684b70 100644 (file)
--- a/util.c
+++ b/util.c
@@ -185,7 +185,7 @@ socket_setup(int fd, const char *ip)
 }
 
 void*
-memdup(void *d, int l)
+memdup(const void *d, int l)
 {
        void *r = malloc(l);
        if (!r)
diff --git a/util.h b/util.h
index fe9f1ea..689e3fd 100644 (file)
--- a/util.h
+++ b/util.h
@@ -24,7 +24,7 @@ extern struct uloop_fd listener;
 extern const char *iface_ip;
 extern int iface_index;
 
-void *memdup(void *d, int l);
+void *memdup(const void *d, int l);
 
 extern void signal_setup(void);
 extern int socket_setup(int fd, const char *ip);