summaryrefslogtreecommitdiff
path: root/libtac
diff options
context:
space:
mode:
Diffstat (limited to 'libtac')
-rw-r--r--libtac/lib/acct_r.c2
-rw-r--r--libtac/lib/connect.c6
-rw-r--r--libtac/lib/read_wait.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/libtac/lib/acct_r.c b/libtac/lib/acct_r.c
index 766f645..16d7c1f 100644
--- a/libtac/lib/acct_r.c
+++ b/libtac/lib/acct_r.c
@@ -126,7 +126,7 @@ int tac_acct_read(int fd, struct areply *re) {
msg=(char *) xcalloc(1, tb->msg_len+1);
bcopy((u_char *) tb+TAC_ACCT_REPLY_FIXED_FIELDS_SIZE, msg, tb->msg_len);
msg[(int)tb->msg_len] = '\0';
- re->msg = msg; // Freed by caller
+ re->msg = msg; /* Freed by caller */
}
/* server logged our request successfully */
diff --git a/libtac/lib/connect.c b/libtac/lib/connect.c
index d6d699e..1844381 100644
--- a/libtac/lib/connect.c
+++ b/libtac/lib/connect.c
@@ -154,7 +154,7 @@ int tac_connect_single(struct addrinfo *server, char *key) {
/* set current tac_secret */
tac_encryption = 0;
- if (key != NULL && strcmp(key, "") != 0) {
+ if (key != NULL && *key) {
tac_encryption = 1;
tac_secret = key;
}
@@ -186,14 +186,14 @@ char *tac_ntop(const struct sockaddr *sa, size_t unused) {
str, INET_ADDRSTRLEN);
snprintf(portstr, sizeof(portstr), ":%hu",
htons(((struct sockaddr_in *)sa)->sin_port));
- strncat(str, portstr, sizeof(portstr));
+ strcat(str, portstr);
break;
case AF_INET6:
inet_ntop(AF_INET6, &(((struct sockaddr_in6 *)sa)->sin6_addr),
str, INET6_ADDRSTRLEN);
snprintf(portstr, sizeof(portstr), ":%hu",
htons(((struct sockaddr_in6 *)sa)->sin6_port));
- strncat(str, portstr, sizeof(portstr));
+ strcat(str, portstr);
break;
default:
strncpy(str, "Unknown AF", INET6_ADDRSTRLEN);
diff --git a/libtac/lib/read_wait.c b/libtac/lib/read_wait.c
index e294c8f..52efa43 100644
--- a/libtac/lib/read_wait.c
+++ b/libtac/lib/read_wait.c
@@ -111,7 +111,7 @@ int tac_read_wait(int fd, int timeout, int size, int *time_left) {
}
}
- if (rc < 0 && errno == EINTR) { // interrupt
+ if (rc < 0 && errno == EINTR) { /* interrupt */
continue;
}