diff options
Diffstat (limited to 'plugins/tests')
-rw-r--r-- | plugins/tests/test-port-context.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/tests/test-port-context.c b/plugins/tests/test-port-context.c index aad359e8..cbf202f0 100644 --- a/plugins/tests/test-port-context.c +++ b/plugins/tests/test-port-context.c @@ -100,13 +100,13 @@ process_next_command (TestPortContext *ctx, static const gchar *error_response = "\r\nERROR\r\n"; /* Find command end */ - while (buffer->data[i] != '\r' && buffer->data[i] != '\n' && i < buffer->len) + while (i < buffer->len && buffer->data[i] != '\r' && buffer->data[i] != '\n') i++; if (i == buffer->len) /* no command */ return NULL; - while ((buffer->data[i] == '\r' || buffer->data[i] == '\n') && i < buffer->len) + while (i < buffer->len && (buffer->data[i] == '\r' || buffer->data[i] == '\n')) buffer->data[i++] = '\0'; /* Setup command and lookup response */ |