The error handling for writes to the target file could lead to the final

fclose() being skipped. Fix this by using boolean "&" and "|" instead of
short-cut operators "&&" and "||".
While here, increment the last part of the version string. The reason is
the fixed output file selection logic in pch.c, which was committed as
r250943, yesterday.

Reviewed by:	pfg
This commit is contained in:
Stefan Eßer 2013-05-24 18:54:52 +00:00
parent 936d0074cc
commit 2360cb0eea
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=250972
2 changed files with 4 additions and 4 deletions

View File

@ -303,7 +303,7 @@ main(int argc, char *argv[])
++fuzz <= mymaxfuzz);
if (skip_rest_of_patch) { /* just got decided */
if (ferror(ofp) || fclose(ofp)) {
if (ferror(ofp) | fclose(ofp)) {
say("Error writing %s\n",
TMPOUTNAME);
error = 1;
@ -385,7 +385,7 @@ main(int argc, char *argv[])
}
}
}
if (ferror(rejfp) || fclose(rejfp)) {
if (ferror(rejfp) | fclose(rejfp)) {
say("Error writing %s\n", rejname);
error = 1;
}
@ -977,7 +977,7 @@ spew_output(void)
#endif
if (input_lines)
copy_till(input_lines, true); /* dump remainder of file */
rv = ferror(ofp) == 0 && fclose(ofp) == 0;
rv = ferror(ofp) == 0 & fclose(ofp) == 0;
ofp = NULL;
return rv;
}

View File

@ -412,7 +412,7 @@ checked_in(char *file)
void
version(void)
{
fprintf(stderr, "patch 2.0-12u8 FreeBSD\n");
fprintf(stderr, "patch 2.0-12u9 FreeBSD\n");
my_exit(EXIT_SUCCESS);
}