Commit 3053bd0adb5ed1cdd11fe4288017127770ea5e67
1 parent
814ef174
CID 69145 - Argument cannot be negative in unit-test-server
Showing
1 changed file
with
4 additions
and
0 deletions
tests/unit-test-server.c
| ... | ... | @@ -161,6 +161,10 @@ int main(int argc, char*argv[]) |
| 161 | 161 | uint8_t req[] = "\x00\x1C\x00\x00\x00\x05\xFF\x03\x02\x00\x00"; |
| 162 | 162 | int req_length = 11; |
| 163 | 163 | int w_s = modbus_get_socket(ctx); |
| 164 | + if (ws_s == -1) { | |
| 165 | + fprintf(stderr, "Unable to get a valid socket in special test\n"); | |
| 166 | + continue; | |
| 167 | + } | |
| 164 | 168 | |
| 165 | 169 | /* Copy TID */ |
| 166 | 170 | req[1] = query[1]; | ... | ... |