From: Jens Axboe Date: Wed, 11 May 2016 01:43:08 +0000 (-0600) Subject: verify: only escape 'name', not prefix+name X-Git-Tag: fio-2.10~29 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;ds=sidebyside;h=f5d1c719d4de7b6b200b9d1d97af10b02db05c2b;p=fio.git verify: only escape 'name', not prefix+name Fixes: e139c0c076e5 ("verify: escape '/' in state file name to '.'") Signed-off-by: Jens Axboe --- diff --git a/verify-state.h b/verify-state.h index 2fe710f1..ccde031a 100644 --- a/verify-state.h +++ b/verify-state.h @@ -83,21 +83,24 @@ static inline void verify_state_gen_name(char *out, size_t size, const char *name, const char *prefix, int num) { + char ename[PATH_MAX]; char *ptr; - snprintf(out, size, "%s-%s-%d-verify.state", prefix, name, num); - out[size - 1] = '\0'; - /* * Escape '/', just turn them into '.' */ - ptr = out; + strcpy(ename, name); + ptr = ename; while ((ptr = strchr(ptr, '/')) != NULL) { *ptr = '.'; ptr++; if (*ptr == '\0') break; } + + snprintf(out, size, "%s-%s-%d-verify.state", prefix, ename, num); + out[size - 1] = '\0'; + } #endif