diff options
author | venaas <venaas> | 2007-01-16 14:04:27 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2007-01-16 14:04:27 +0000 |
commit | 234912c553f7808f25064b1a3980eb3651bb313e (patch) | |
tree | a590d3f313cd7bb472816bd4d1e1f89fe8a65d04 /util.c | |
parent | 10b6ffd2053e96df55c3f7693980aa9dbe68ba16 (diff) |
added code for reading main config and restructured tls init code
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@39 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -45,6 +45,18 @@ void err(char *format, ...) { fprintf(stderr, "\n"); } +char *stringcopy(char *s, int len) { + char *r; + if (!len) + len = strlen(s); + r = malloc(len + 1); + if (!r) + errx("stringcopy: malloc failed"); + memcpy(r, s, len); + r[len] = '\0'; + return r; +} + char *addr2string(struct sockaddr *addr, socklen_t len) { struct sockaddr_in6 *sa6; struct sockaddr_in sa4; |