diff options
-rw-r--r-- | src/depend/depend.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/depend/depend.cpp b/src/depend/depend.cpp index 4d5ef35f3..1805e3286 100644 --- a/src/depend/depend.cpp +++ b/src/depend/depend.cpp @@ -922,7 +922,10 @@ int main(int argc, char *argv[]) if (size != 0) { src = fopen(backup, "wb"); - fwrite(content, 1, size, src); + if (fwrite(content, 1, size, src) != (size_t)size) { + fprintf(stderr, "Could not write %s\n", filename); + exit(-2); + } fclose(src); /* Then append it to the real file. */ |