summaryrefslogtreecommitdiffstats
path: root/libopkg
diff options
context:
space:
mode:
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-11-22 18:15:15 (EST)
committer graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-11-22 18:15:15 (EST)
commitd54fe7a27ca63446a689c4020473c47e4bf787fc (patch)
tree9c01a118437fbf1e3e0b7f0dffc92a520bb4593d /libopkg
parent010f770102220799a83245db81110df0d7940aad (diff)
Add some error checking on fputs.
git-svn-id: http://opkg.googlecode.com/svn/trunk@346 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg')
-rw-r--r--libopkg/pkg_extract.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libopkg/pkg_extract.c b/libopkg/pkg_extract.c
index 4257d59..e1b4018 100644
--- a/libopkg/pkg_extract.c
+++ b/libopkg/pkg_extract.c
@@ -37,7 +37,11 @@ int pkg_extract_control_file_to_stream(pkg_t *pkg, FILE *stream)
return EINVAL;
}
- fputs(buffer, stream);
+ if (fputs(buffer, stream) == EOF) {
+ free(buffer);
+ return EINVAL;
+ }
+
free(buffer);
return 0;