Skip to content

Commit 1ac55dd

Browse files
committed
Makefile: no need to ignore the if statement
1 parent 940974f commit 1ac55dd

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ clean:
1919
rm -f dsvpn *~ $(CFLAGS_FILE) $(COMPILE_TEST_FILE)
2020

2121
$(CFLAGS_FILE):
22-
@CFLAGS="$(CFLAGS)"
23-
@if [ -z "$$CFLAGS" ]; then \
22+
@CFLAGS="$(CFLAGS)"; \
23+
if [ -z "$$CFLAGS" ]; then \
2424
if [ ! -r "$(CFLAGS_FILE)" ]; then \
2525
echo "int main(void) { return 0; }" > "$(COMPILE_TEST_FILE)"; \
2626
for flag in -march=native -mtune=native -O3 -Wno-unused-command-line-argument; do \
2727
$(CC) $${CFLAGS} $${flag} "$(COMPILE_TEST_FILE)" >/dev/null 2>&1 && CFLAGS="$$CFLAGS $$flag"; \
2828
done; \
29-
rm -f a.out \
29+
rm -f a.out; \
3030
CFLAGS="$${CFLAGS} -Wall -W -Wshadow -Wmissing-prototypes"; \
3131
fi \
3232
fi; \

src/vpn.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -441,13 +441,14 @@ static int event_loop(Context *context)
441441
if (client_buf->pos < (len_with_header = 2 + TAG_LEN + (size_t) len)) {
442442
break;
443443
}
444-
if (len > sizeof client_buf->data || uc_decrypt(context->uc_st[1], client_buf->data,
445-
len, client_buf->tag, TAG_LEN) != 0) {
444+
if ((size_t) len > sizeof client_buf->data ||
445+
uc_decrypt(context->uc_st[1], client_buf->data, (size_t) len, client_buf->tag,
446+
TAG_LEN) != 0) {
446447
fprintf(stderr, "Corrupted stream\n");
447448
sleep(1);
448449
return client_reconnect(context);
449450
}
450-
if (tun_write(context->tun_fd, client_buf->data, len) != len) {
451+
if (tun_write(context->tun_fd, client_buf->data, (size_t) len) != len) {
451452
perror("tun_write");
452453
}
453454
if (2 + TAG_LEN + MAX_PACKET_LEN != len_with_header) {
@@ -512,7 +513,7 @@ __attribute__((noreturn)) static void usage(void)
512513
"\n"
513514
"dsvpn\t\"server\"\n\t<key file>\n\t<vpn server ip or name>|\"auto\"\n\t<vpn "
514515
"server port>|\"auto\"\n\t<tun interface>|\"auto\"\n\t<local tun "
515-
"ip>|\"auto\"\n\t<remote tun ip>\"auto\"\n\t<external ip>|\"auto\""
516+
"ip>|\"auto\"\n\t<remote tun ip>|\"auto\"\n\t<external ip>|\"auto\""
516517
"\n\n"
517518
"dsvpn\t\"client\"\n\t<key file>\n\t<vpn server ip or name>\n\t<vpn server "
518519
"port>|\"auto\"\n\t<tun interface>|\"auto\"\n\t<local tun "

0 commit comments

Comments
 (0)