#include <stdint.h>
#include <string.h>
+#include <limits.h>
+#include "lib/nowarn_snprintf.h"
struct thread_rand32_state {
uint32_t s[4];
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,
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);
+
+ nowarn_snprintf(out, size, "%s-%s-%d-verify.state", prefix, ename, num);
+ out[size - 1] = '\0';
}
#endif