X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=verify-state.h;h=1586f63fb0f0a61f7eea2a6db90876b24f895960;hp=ccde031adc6b0cb850420663db88fb34331a1af4;hb=34851ad5ffacf9f4f8a7f23ee2edb17281b917a0;hpb=f5d1c719d4de7b6b200b9d1d97af10b02db05c2b diff --git a/verify-state.h b/verify-state.h index ccde031a..1586f63f 100644 --- a/verify-state.h +++ b/verify-state.h @@ -3,6 +3,7 @@ #include #include +#include struct thread_rand32_state { uint32_t s[4]; @@ -76,7 +77,7 @@ static inline size_t thread_io_list_sz(struct thread_io_list *s) static inline struct thread_io_list *io_list_next(struct thread_io_list *s) { - return (void *) s + thread_io_list_sz(s); + return (struct thread_io_list *)((char *) s + thread_io_list_sz(s)); } static inline void verify_state_gen_name(char *out, size_t size, @@ -89,18 +90,19 @@ static inline void verify_state_gen_name(char *out, size_t size, /* * Escape '/', just turn them into '.' */ - strcpy(ename, name); ptr = ename; - while ((ptr = strchr(ptr, '/')) != NULL) { - *ptr = '.'; - ptr++; + 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