diff options
Diffstat (limited to 'testing/tox_shell.c')
-rw-r--r-- | testing/tox_shell.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/testing/tox_shell.c b/testing/tox_shell.c index 9c71a2d7..f6dae7b9 100644 --- a/testing/tox_shell.c +++ b/testing/tox_shell.c | |||
@@ -47,10 +47,11 @@ | |||
47 | 47 | ||
48 | void print_online(Tox *tox, uint32_t friendnumber, TOX_CONNECTION status, void *userdata) | 48 | void print_online(Tox *tox, uint32_t friendnumber, TOX_CONNECTION status, void *userdata) |
49 | { | 49 | { |
50 | if (status) | 50 | if (status) { |
51 | printf("\nOther went online.\n"); | 51 | printf("\nOther went online.\n"); |
52 | else | 52 | } else { |
53 | printf("\nOther went offline.\n"); | 53 | printf("\nOther went offline.\n"); |
54 | } | ||
54 | } | 55 | } |
55 | 56 | ||
56 | void print_message(Tox *tox, uint32_t friendnumber, TOX_MESSAGE_TYPE type, const uint8_t *string, size_t length, | 57 | void print_message(Tox *tox, uint32_t friendnumber, TOX_MESSAGE_TYPE type, const uint8_t *string, size_t length, |
@@ -66,8 +67,9 @@ int main(int argc, char *argv[]) | |||
66 | uint8_t ipv6enabled = 1; /* x */ | 67 | uint8_t ipv6enabled = 1; /* x */ |
67 | int argvoffset = cmdline_parsefor_ipv46(argc, argv, &ipv6enabled); | 68 | int argvoffset = cmdline_parsefor_ipv46(argc, argv, &ipv6enabled); |
68 | 69 | ||
69 | if (argvoffset < 0) | 70 | if (argvoffset < 0) { |
70 | exit(1); | 71 | exit(1); |
72 | } | ||
71 | 73 | ||
72 | /* with optional --ipvx, now it can be 1-4 arguments... */ | 74 | /* with optional --ipvx, now it can be 1-4 arguments... */ |
73 | if ((argc != argvoffset + 2) && (argc != argvoffset + 4)) { | 75 | if ((argc != argvoffset + 2) && (argc != argvoffset + 4)) { |
@@ -147,8 +149,9 @@ int main(int argc, char *argv[]) | |||
147 | uint8_t buf[TOX_MAX_MESSAGE_LENGTH]; | 149 | uint8_t buf[TOX_MAX_MESSAGE_LENGTH]; |
148 | ret = read(*master, buf, sizeof(buf)); | 150 | ret = read(*master, buf, sizeof(buf)); |
149 | 151 | ||
150 | if (ret <= 0) | 152 | if (ret <= 0) { |
151 | break; | 153 | break; |
154 | } | ||
152 | 155 | ||
153 | tox_friend_send_message(tox, num, TOX_MESSAGE_TYPE_NORMAL, buf, ret, 0); | 156 | tox_friend_send_message(tox, num, TOX_MESSAGE_TYPE_NORMAL, buf, ret, 0); |
154 | } | 157 | } |