X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=lib%2Fremopen.c;h=595f620ac1345371cb76d84996fe07b8a3007296;hb=94b7914e7dd5ba544fec9e0f89540822a5b30468;hp=dfe08654dec98661287e1aaded6cc31cbf618f35;hpb=476a3c053948987988b192d5cea513d01866a750;p=inn-innduct.git diff --git a/lib/remopen.c b/lib/remopen.c index dfe0865..595f620 100644 --- a/lib/remopen.c +++ b/lib/remopen.c @@ -21,7 +21,7 @@ /* ** store an error message in buff like libinn(3) says NNTPconnect does */ -static void store_error(char *buff, char *string1, char *string2) { +static void store_error(char *buff, const char *string1, const char *string2) { /* we put these in [...] to make it easier to tell them apart * from messages sent by the server */ snprintf(buff, NNTP_STRLEN, "[%s%s]", string1, string2); @@ -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);