diff --git a/src/rhosts.c b/src/rhosts.c index f9887bb..8cb11e5 100644 --- a/src/rhosts.c +++ b/src/rhosts.c @@ -136,10 +136,21 @@ int preserve_static_entries(){ if (strncmp(buff, "# rhosts begin", 14) == 0){c = EOF;} if (c == '\n'){ rc = fputs(buff, tmpf); + if (rc == EOF){ + fclose(hostsf); + fclose(tmpf); + return 1; + } printf("%s",buff); buff[0] = '\0'; } }while ( c != EOF); + rc = fputs("# rhosts begin\n", tmpf); + if (rc == EOF){ + fclose(hostsf); + fclose(tmpf); + return 1; + }