Index: libiberty/pex-unix.c |
diff --git a/libiberty/pex-unix.c b/libiberty/pex-unix.c |
index 8d5145c523e6950bcdae209d4c6933eed284daa5..addf8ee23dfa82bce2a172ce6b40eb15689dd0ca 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; |