aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-12-22 18:29:23 +0000
committerMike Frysinger <vapier@gentoo.org>2011-12-22 18:29:23 +0000
commitff8554d6bdeeca9b0336415cb6b7152c6edac899 (patch)
tree5264b5afcf0faf158df8e4eea0f6f5e672e2f8e1
parenthave the one user pass in an empty string rather than always checking the param (diff)
downloadportage-utils-ff8554d6bdeeca9b0336415cb6b7152c6edac899.tar.gz
portage-utils-ff8554d6bdeeca9b0336415cb6b7152c6edac899.tar.bz2
portage-utils-ff8554d6bdeeca9b0336415cb6b7152c6edac899.zip
since sizeof(dirent) is not portable (and will break on some systems), use the d_reclen member instead ... it still isnt entirely portable, but at least it works when it is available
-rw-r--r--libq/scandirat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libq/scandirat.c b/libq/scandirat.c
index 5ab2972..7a2b95b 100644
--- a/libq/scandirat.c
+++ b/libq/scandirat.c
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2011 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/libq/scandirat.c,v 1.2 2011/12/18 06:31:29 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/libq/scandirat.c,v 1.3 2011/12/22 18:29:23 vapier Exp $
*
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2011 Mike Frysinger - <vapier@gentoo.org>
@@ -31,7 +31,7 @@ static int scandirat(int dir_fd, const char *dir, struct dirent ***dirlist,
continue;
ret = realloc(ret, sizeof(*ret) * (cnt + 1));
- ret[cnt++] = xmemdup(de, sizeof(*de));
+ ret[cnt++] = xmemdup(de, de->d_reclen);
}
*dirlist = ret;