From: Ian Jackson Date: Tue, 8 Oct 2019 16:22:49 +0000 (+0100) Subject: privcache: Use new pathprefix_template facility X-Git-Tag: v0.6.0~208 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=c52b7f938b6bd42d73f557b8b07ac9d751add3be;p=secnet.git privcache: Use new pathprefix_template facility Signed-off-by: Ian Jackson --- diff --git a/privcache.c b/privcache.c index 0ad6a0e..50da4b5 100644 --- a/privcache.c +++ b/privcache.c @@ -171,10 +171,7 @@ static list_t *privcache_apply(closure_t *self, struct cloc loc, buffer_new(&st->databuf,buflen+1); const char *path=dict_read_string(dict,"privkeys",True,"privcache",loc); - int l=strlen(path); - NEW_ARY(st->path.buffer,l+KEYIDSZ*2+1); - strcpy(st->path.buffer,path); - st->path.write_here=st->path.buffer+l; + pathprefix_template_init(&st->path,path,KEYIDSZ*2); st->defhash=find_cl_if(dict,"hash",CL_HASH,False,"site",loc);