Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.250
 
1.251
 
MAIN:plunky:20120907092440
 
cc.c
_>18131813 win32pathsubst(char *s)
 18141814 {
 18151815         char env[1024];
<>1816 -        char *rv;
 1817 -        int len;
  1816+        DWORD len;
18181817 
 18191818         len = ExpandEnvironmentStrings(s, env, sizeof(env));
<>1820 -        if (len <= 0)
 1821 -                return s;
  1819+        if (len == 0 || len > sizeof(env))
  1820+                errorx(8, "ExpandEnvironmentStrings failed, len %lu", len);
18221821 
<>1823 -        while (env[len-1] == '/' || env[len-1] == '\\' || env[len-1] == '\0')
 1824 -                env[--len] = 0;
  1822+        len--;  /* skip nil */
  1823+        while (len-- > 0 && (env[len] == '/' || env[len] == '\\'))
  1824+                env[len] = '\0';
18251825 
<>1826 -        rv = xmalloc(len+1);
 1827 -        strlcpy(rv, env, len+1);
 1828 -
 1829 -        return rv;
  1826+        return xstrdup(env);
<_18301827 }
 18311828 
 18321829 char *
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-09-03 04:09 +0200