summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter de Jong <walter@heiho.net>2013-03-22 22:32:42 +0100
committerWalter de Jong <walter@heiho.net>2013-03-22 22:32:42 +0100
commit33f6c8c8092251cd634100c2bcab1dcf8e202c18 (patch)
treec8438b31f684751389f66e4953551df4c6006ab8
parent79add426641ee685205d473605fd315cd60043f9 (diff)
downloadpam_tacplus-33f6c8c8092251cd634100c2bcab1dcf8e202c18.tar.gz
pam_tacplus-33f6c8c8092251cd634100c2bcab1dcf8e202c18.zip
code cleanup
-rw-r--r--support.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/support.c b/support.c
index 1e048a4..977537d 100644
--- a/support.c
+++ b/support.c
@@ -242,10 +242,11 @@ int _pam_parse (int argc, const char **argv) {
strcpy(server_buf, *argv + 7);
port = strchr(server_buf, ':');
- if (port)
+ if (port != NULL) {
*port = '\0';
-
- if ((rv = getaddrinfo(server_buf, (port == NULL ? "49" : port+1), &hints, &servers)) == 0) {
+ port++;
+ }
+ if ((rv = getaddrinfo(server_buf, (port == NULL) ? "49" : port, &hints, &servers)) == 0) {
for(server = servers; server != NULL && tac_srv_no < TAC_PLUS_MAXSERVERS; server = server->ai_next) {
tac_srv[tac_srv_no] = server;
tac_srv_no++;