summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-cache.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index 5d1ee5615..e847de875 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -1187,7 +1187,8 @@ bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V)
DescP = Buffer + Vf->Size;
// Write all but Description
- if (fwrite(Buffer,1,DescP - Buffer,stdout) < (size_t)(DescP - Buffer))
+ size_t const length = DescP - Buffer;
+ if (length != 0 && FileFd::Write(STDOUT_FILENO, Buffer, length) == false)
{
delete [] Buffer;
return false;
@@ -1223,7 +1224,7 @@ bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V)
DescP = skipDescriptionFields(End + strlen("Description"));
}
size_t const length = End - Start;
- if (fwrite(Start, 1, length, stdout) < length)
+ if (length != 0 && FileFd::Write(STDOUT_FILENO, Start, length) == false)
{
delete [] Buffer;
return false;
@@ -1232,8 +1233,8 @@ bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V)
// write a final newline after the last field
cout<<endl;
- delete [] Buffer;
+ delete [] Buffer;
return true;
}
/*}}}*/