aboutsummaryrefslogtreecommitdiff
path: root/libiberty/pex-unix.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2012-04-10 17:07:35 +0000
committerDJ Delorie <dj@redhat.com>2012-04-10 17:07:35 +0000
commitb3641a6eb9d85ff72c04f0ac8cf140c73e47aa94 (patch)
treef550ac103a3bdbf60f410fce463379436838e1d5 /libiberty/pex-unix.c
parent9a82b8ff879eb1e69e4050c2d79f299443a2b613 (diff)
downloadgdb-b3641a6eb9d85ff72c04f0ac8cf140c73e47aa94.zip
gdb-b3641a6eb9d85ff72c04f0ac8cf140c73e47aa94.tar.gz
gdb-b3641a6eb9d85ff72c04f0ac8cf140c73e47aa94.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty/pex-unix.c')
-rw-r--r--libiberty/pex-unix.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libiberty/pex-unix.c b/libiberty/pex-unix.c
index 8d5145c..addf8ee 100644
--- a/libiberty/pex-unix.c
+++ b/libiberty/pex-unix.c
@@ -85,13 +85,15 @@ to_ptr32 (char **ptr64)
int argc;
__char_ptr_char_ptr32 short_argv;
- for (argc=0; ptr64[argc]; argc++);
+ /* Count number of arguments. */
+ for (argc = 0; ptr64[argc] != NULL; argc++)
+ ;
/* Reallocate argv with 32 bit pointers. */
short_argv = (__char_ptr_char_ptr32) decc$malloc
(sizeof (__char_ptr32) * (argc + 1));
- for (argc=0; ptr64[argc]; argc++)
+ for (argc = 0; ptr64[argc] != NULL; argc++)
short_argv[argc] = (__char_ptr32) decc$strdup (ptr64[argc]);
short_argv[argc] = (__char_ptr32) 0;