Formerly main.c.~102~
authorRoland McGrath <roland@redhat.com>
Wed, 15 Dec 1993 22:49:45 +0000 (22:49 +0000)
committerRoland McGrath <roland@redhat.com>
Wed, 15 Dec 1993 22:49:45 +0000 (22:49 +0000)
main.c

diff --git a/main.c b/main.c
index f83f2fe..8d91af1 100644 (file)
--- a/main.c
+++ b/main.c
@@ -497,7 +497,11 @@ main (argc, argv, envp)
       register char *ep = envp[i];
       while (*ep != '=')
        ++ep;
-      define_variable (envp[i], ep - envp[i], ep + 1, o_env, 1)
+      /* The result of pointer arithmetic is cast to unsigned int for
+        machines where ptrdiff_t is a different size that doesn't widen
+        the same.  */
+      define_variable (envp[i], (unsigned int) (ep - envp[i]),
+                      ep + 1, o_env, 1)
        /* Force exportation of every variable culled from the environment.
           We used to rely on target_environment's v_default code to do this.
           But that does not work for the case where an environment variable