X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;ds=sidebyside;f=verify-state.h;h=901aa0a47bcec6d016485e4c6b518c8fa65171d0;hb=ba8fb6f6f12800ee3a0e637dfdac4e9aaa6b2123;hp=2fe710f19f9f2f5aeb95c2a9e4d21c25acfd88c3;hpb=e139c0c076e596143a13ce4cbf062120c30b338f;p=fio.git diff --git a/verify-state.h b/verify-state.h index 2fe710f1..901aa0a4 100644 --- a/verify-state.h +++ b/verify-state.h @@ -83,21 +83,25 @@ 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; - while ((ptr = strchr(ptr, '/')) != NULL) { - *ptr = '.'; - ptr++; + ptr = ename; + do { + *ptr = *name; if (*ptr == '\0') break; - } + else if (*ptr == '/') + *ptr = '.'; + ptr++; + name++; + } while (1); + + snprintf(out, size, "%s-%s-%d-verify.state", prefix, ename, num); + out[size - 1] = '\0'; } #endif