+ len = strlen(repo_path) + strlen(repo_file(i)->path) + 1;
+ if(len > pathbuf_sz) {
+ free(pathbuf);
+ if(!(pathbuf = malloc(len + 1))) {
+ fprintf(stderr, "gen_flist: failed to allocate path buffer (%d bytes)\n", len + 1);
+ repo_cleanup();
+ flist_destroy(flist);
+ return 0;
+ }
+ }
+ sprintf(pathbuf, "%s/%s", repo_path, repo_file(i)->path);
+ flist_add(flist, pathbuf, contents);