Skip to content

Commit 3053bd0

Browse files
committed
CID 69145 - Argument cannot be negative in unit-test-server
1 parent 814ef17 commit 3053bd0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/unit-test-server.c

+4
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ int main(int argc, char*argv[])
161161
uint8_t req[] = "\x00\x1C\x00\x00\x00\x05\xFF\x03\x02\x00\x00";
162162
int req_length = 11;
163163
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+
}
164168

165169
/* Copy TID */
166170
req[1] = query[1];

0 commit comments

Comments
 (0)