aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c16
-rw-r--r--tls.c1
2 files changed, 7 insertions, 10 deletions
diff --git a/main.c b/main.c
index 92d8546..a832b36 100644
--- a/main.c
+++ b/main.c
@@ -132,16 +132,14 @@ void *client_loop(void *ign) {
uint64_t old_offset = offset;
if (offset < msg_len) {
while (offset < msg_len) {
- if (full_msg.data[offset] == ':') {
- argc++;
+ argc++;
+
+ if (full_msg.data[offset] == ':')
break;
- }
while (offset < msg_len && full_msg.data[offset] != ' ')
offset++;
- argc++;
-
while (offset < msg_len && full_msg.data[offset] == ' ')
offset++;
}
@@ -369,16 +367,14 @@ int main(void) {
uint64_t old_offset = offset;
if (offset < msg_len) {
while (offset < msg_len) {
- if (full_msg.data[offset] == ':') {
- argc++;
+ argc++;
+
+ if (full_msg.data[offset] == ':')
break;
- }
while (offset < msg_len && full_msg.data[offset] != ' ')
offset++;
- argc++;
-
while (offset < msg_len && full_msg.data[offset] == ' ')
offset++;
}
diff --git a/tls.c b/tls.c
index d526812..ed15623 100644
--- a/tls.c
+++ b/tls.c
@@ -27,6 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
#include <gnutls/gnutls.h>
+#include <gnutls/x509.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <arpa/inet.h>