diff options
author | Linus Nordberg <linus@nordu.net> | 2016-10-19 14:10:58 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2016-10-19 14:10:58 +0200 |
commit | 72709ca59adab355a4d82f7033217b9ab43cddb7 (patch) | |
tree | 2bbc6cbc0aae83f5d002582abdcd04d4faa3e334 | |
parent | 28037df78160dc05fd56151b7c837eb4709d83c1 (diff) |
Make addr2string(), returning a literal string, const.
-rw-r--r-- | util.c | 2 | ||||
-rw-r--r-- | util.h | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -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]; @@ -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); |