aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-03-15 08:52:59 +0000
committerMike Frysinger <vapier@gentoo.org>2009-03-15 08:52:59 +0000
commit07ce7c7469d1787e604c627a5eaa6750311faabf (patch)
tree9660105677f2d863ee74072522ea5be2ab418326 /paxinc.c
parentcheck return values of fscanf() and chdir() since gcc whines about it now (diff)
downloadpax-utils-07ce7c7469d1787e604c627a5eaa6750311faabf.tar.gz
pax-utils-07ce7c7469d1787e604c627a5eaa6750311faabf.tar.bz2
pax-utils-07ce7c7469d1787e604c627a5eaa6750311faabf.zip
check return value of read() since gcc whines about it now
Diffstat (limited to 'paxinc.c')
-rw-r--r--paxinc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/paxinc.c b/paxinc.c
index c165698..61939a7 100644
--- a/paxinc.c
+++ b/paxinc.c
@@ -1,7 +1,7 @@
/*
* Copyright 2003-2007 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxinc.c,v 1.12 2008/12/30 13:34:46 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/pax-utils/paxinc.c,v 1.13 2009/03/15 08:52:59 vapier Exp $
*
* Copyright 2005-2007 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2007 Mike Frysinger - <vapier@gentoo.org>
@@ -69,7 +69,8 @@ close_and_ret:
* '\n' is used for padding */
if (ret.buf.raw[0] == '\n') {
memmove(ret.buf.raw, ret.buf.raw+1, 59);
- read(ar->fd, ret.buf.raw+59, 1);
+ if (read(ar->fd, ret.buf.raw+59, 1) != 1)
+ goto close_and_ret;
}
if ((ret.buf.formatted.magic[0] != '`') || (ret.buf.formatted.magic[1] != '\n')) {