summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2016-10-19 14:10:58 +0200
committerLinus Nordberg <linus@nordu.net>2016-10-19 14:10:58 +0200
commit72709ca59adab355a4d82f7033217b9ab43cddb7 (patch)
tree2bbc6cbc0aae83f5d002582abdcd04d4faa3e334
parent28037df78160dc05fd56151b7c837eb4709d83c1 (diff)
Make addr2string(), returning a literal string, const.
-rw-r--r--util.c2
-rw-r--r--util.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/util.c b/util.c
index 98d6680..bf327ad 100644
--- a/util.c
+++ b/util.c
@@ -76,7 +76,7 @@ struct sockaddr *addr_copy(struct sockaddr *in) {
return out;
}
-char *addr2string(struct sockaddr *addr) {
+const char *addr2string(struct sockaddr *addr) {
struct sockaddr_in6 *sa6;
struct sockaddr_in sa4;
static char addr_buf[2][INET6_ADDRSTRLEN];
diff --git a/util.h b/util.h
index 924392a..099a30f 100644
--- a/util.h
+++ b/util.h
@@ -13,7 +13,7 @@
sizeof(struct sockaddr_in6))
char *stringcopy(const char *s, int len);
-char *addr2string(struct sockaddr *addr);
+const char *addr2string(struct sockaddr *addr);
struct sockaddr *addr_copy(struct sockaddr *in);
void port_set(struct sockaddr *sa, uint16_t port);