summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/afb-client-demo.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/afb-client-demo.c b/src/afb-client-demo.c
index 4f8882e2..434c6d17 100644
--- a/src/afb-client-demo.c
+++ b/src/afb-client-demo.c
@@ -222,9 +222,10 @@ static int io_event_callback(sd_event_source *src, int fd, uint32_t revents, voi
rest[0] = i; while(i < count && line[i] != '\n') i++; rest[1] = i;
if (i == count) break;
line[i++] = 0;
- if (api[0] == api[1] || verb[0] == verb[1])
- fprintf(stderr, "bad line: %s\n", line+pos);
- else {
+ if (api[0] == api[1] || verb[0] == verb[1]) {
+ if (api[0] != api[1] || verb[0] != verb[1])
+ fprintf(stderr, "bad line: %s\n", line+pos);
+ } else {
line[api[1]] = line[verb[1]] = 0;
emit(line + api[0], line + verb[0], line + rest[0]);
}