id = read_int(f);
while (id != 0) {
int len = read_byte(f);
- name = (char *)malloc(len);
+ name = (char *)malloc(len+1);
if (!name) out_of_memory("recv_uid_list");
- read_buf(f, name, len);
+ read_sbuf(f, name, len);
if (!list) {
uidlist = add_list(id, name);
list = uidlist;
id = read_int(f);
while (id != 0) {
int len = read_byte(f);
- name = (char *)malloc(len);
+ name = (char *)malloc(len+1);
if (!name) out_of_memory("recv_uid_list");
- read_buf(f, name, len);
+ read_sbuf(f, name, len);
if (!list) {
gidlist = add_list(id, name);
list = gidlist;
/* now convert the uid/gid of all files in the list to the mapped
uid/gid */
for (i=0;i<flist->count;i++) {
- if (preserve_uid && flist->files[i].uid != 0) {
- flist->files[i].uid = match_uid(flist->files[i].uid);
+ if (preserve_uid && flist->files[i]->uid != 0) {
+ flist->files[i]->uid = match_uid(flist->files[i]->uid);
}
- if (preserve_gid && flist->files[i].gid != 0) {
- flist->files[i].gid = match_gid(flist->files[i].gid);
+ if (preserve_gid && flist->files[i]->gid != 0) {
+ flist->files[i]->gid = match_gid(flist->files[i]->gid);
}
}
}