chiark / gitweb /
get sense of ferror check right inn.feature.remopen
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sat, 1 May 2010 13:10:42 +0000 (14:10 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sat, 22 May 2010 12:05:21 +0000 (13:05 +0100)
lib/remopen.c

index b0fc642..595f620 100644 (file)
@@ -209,7 +209,7 @@ int NNTPconnect(char *host, int port, FILE **FromServerp, FILE **ToServerp, char
            return -1;
        }
        if (fgets(buff, sizeof mybuff, F) == NULL) {
-           if (ferror(F)) store_error(buff, "peer closed connection","");
+           if (!ferror(F)) store_error(buff, "peer closed connection","");
            else store_error(buff, "fgets failed: ", strerror(errno));
            oerrno = errno;
            fclose(F);