From 3d3dcbe0c56fb8c84f5435b716958e1328971d02 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Sat, 28 May 2016 17:53:11 -0700 Subject: [PATCH] dll: fsp_fuse_opt_add_opt: testing --- src/dll/fuse/fuse_opt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/dll/fuse/fuse_opt.c b/src/dll/fuse/fuse_opt.c index 43684e6b..c8961545 100644 --- a/src/dll/fuse/fuse_opt.c +++ b/src/dll/fuse/fuse_opt.c @@ -495,22 +495,24 @@ static int fsp_fuse_opt_add_opt_internal(char **opts, const char *opt, int escap newopts = memalloc(optsize + optlen + 1); if (0 == newopts) return -1; - memfree(*opts); - *opts = newopts; if (0 != optsize) { memcpy(newopts, *opts, optsize - 1); newopts[optsize - 1] = ','; - newopts += optsize; } + memfree(*opts); + *opts = newopts; + newopts += optsize; + for (p = opt; *p; p++, newopts++) { if (escaped && (',' == *p || '\\' == *p)) *newopts++ = '\\'; *newopts = *p; } + *newopts = '\0'; return 0; }