/*
** 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);
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);