diff --git a/hw5/src/tu.c b/hw5/src/tu.c index 527a0dd..846ebc8 100644 --- a/hw5/src/tu.c +++ b/hw5/src/tu.c @@ -521,7 +521,7 @@ int tu_chat(TU *tu, char *msg) { { debug("sending msg"); int status = 0; - if (fprintf(target->f, "CHAT %s\r\n", msg) < 0 && fflush(target->f) < 0) + if (fprintf(target->f, "CHAT %s\r\n", msg) < 0 || fflush(target->f) < 0) status = -1; if (tu_notify(tu) < 0) status = -1;