Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.183
 
1.184
 
MAIN:plunky:20110606133056
 
cc.c
_>12941294 {
 12951295         file_prefixes = realloc(file_prefixes,
 12961296             sizeof(*file_prefixes) * (file_prefixes_cnt + 1));
<>1297 -        if (file_prefixes == NULL) {
 1298 -                error("malloc failed");
 1299 -                exit(1);
 1300 -        }
 1301 -        if ((file_prefixes[file_prefixes_cnt++] = strdup(prefix)) == NULL) {
 1302 -                error("malloc failed");
 1303 -                exit(1);
 1304 -        }
  1297+        if (file_prefixes == NULL)
  1298+                errorx(1, "malloc failed");
  1299+        file_prefixes[file_prefixes_cnt++] = copy(prefix, 0);
13051300 }
 13061301 
 13071302 static char *
     
 !
13141309 
 13151310         for (i = 0; i < file_prefixes_cnt; ++i) {
 13161311                 prefix_len = strlen(file_prefixes[i]);
<>1317 -                len = prefix_len + + baselen + 2;
  1312+                len = prefix_len + baselen + 2;
13181313                 if (file_prefixes[i][0] == '=') {
 13191314                         len += sysrootlen;
<>1320 -                        path = malloc(len);
  1315+                        path = ccmalloc(len);
13211316                         snprintf(path, len, "%s%s/%s", sysroot,
 13221317                             file_prefixes[i] + 1, base);
 13231318                 } else {
<>1324 -                        path = malloc(len);
  1319+                        path = ccmalloc(len);
13251320                         snprintf(path, len, "%s/%s", file_prefixes[i], base);
 13261321                 }
 13271322                 if (access(path, mode) == 0)
 13281323                         return path;
 13291324                 free(path);
 13301325         }
 13311326 
<>1332 -        path = strdup(base);
 1333 -        if (path == NULL) {
 1334 -                error("malloc failed");
 1335 -                exit(1);
 1336 -        }
 1337 -        return path;
  1327+        return copy(base, 0);
<_13381328 }
 13391329 
 13401330 int
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-07-11 04:21 +0200