+#define _DEFAULT_SOURCE
#define _XOPEN_SOURCE 500
#include <signal.h>
#include <stdio.h>
conn_last = conn_curr;
count = 0;
- char *lineptr = &line;
+ char *lineptr = line;
while (1) {
- if (*lineptr == NULL)
+ if (*lineptr == '\0')
break;
resultptr = result;
- while (*lineptr != NULL) {
+ while (*lineptr != '\0') {
if (*lineptr == ',') {
lineptr++;
break;
}
const char *zones[] = {"GREEN", "BLUE", "ORANGE", NULL};
- char *zone = NULL;
+ const char *zone = NULL;
// Get net address of the local openvpn subnet.
char *subnetmask = strdup(conn->local_subnet);
}
static void stopAuthenticator() {
- const char* argv[] = {
+ char* argv[] = {
"/usr/sbin/openvpn-authenticator",
NULL,
};
stopAuthenticator();
int pid = readPidFile("/var/run/openvpn.pid");
- if (!pid > 0) {
+ if (pid <= 0) {
exit(1);
}
}
static int startAuthenticator(void) {
- const char* argv[] = { "-d", NULL };
+ char* argv[] = { "-d", NULL };
return run("/usr/sbin/openvpn-authenticator", argv);
}
snprintf(pidfile, STRING_SIZE - 1, "/var/run/%sn2n.pid", conn->name);
int pid = readPidFile(pidfile);
- if (!pid > 0) {
+ if (pid <= 0) {
fprintf(stderr, "Could not read pid file of connection %s.", conn->name);
return 1;
}
u8 len, addr[HWMAX];
};
-static inline hw_eq(struct hwaddr *h, int hl, u8 *ha)
+static inline int hw_eq(struct hwaddr *h, int hl, u8 *ha)
{
return h->len == hl && memcmp(h->addr, ha, hl) == 0;
}
q = p + 11;
goto print;
}
-}
\ No newline at end of file
+}