simplified FsFtags handling

This commit is contained in:
Anselm R. Garbe 2006-03-09 16:41:11 +01:00
parent 91f324448d
commit beeeede159
1 changed files with 7 additions and 10 deletions

View File

@ -1322,19 +1322,16 @@ xwrite(IXPConn *c, Fcall *fcall)
resize_all_clients();
break;
case FsFtags:
if(fcall->count > sizeof(buf))
return "tags value too long";
memcpy(buf, fcall->data, fcall->count);
buf[fcall->count] = 0;
if(m->qid.dir_type == FsDclient) {
f = tag[i1]->area[i2]->frame[i3];
if(fcall->count > sizeof(f->client->tags))
return "tags value too long";
memcpy(f->client->tags, fcall->data, fcall->count);
f->client->tags[fcall->count] = 0;
}
else {
if(fcall->count > sizeof(client[i1]->tags))
return "tags value too long";
memcpy(client[i1]->tags, fcall->data, fcall->count);
client[i1]->tags[fcall->count] = 0;
cext_strlcat(f->client->tags, buf, sizeof(f->client->tags));
}
else
cext_strlcpy(client[i1]->tags, buf, sizeof(client[i1]->tags));
update_tags();
break;
case FsFgeom: