Copying the format string multiple times? That seems to be a complicated and (from a performance standpoint) wasteful approach. Why not just iterate through the format string, character by character? (The format string should be
const char *, by the way.) If the character is the null terminator, finish. If it's a percent sign, read and handle the format specifier. Otherwise, it's a literal character, so just print it out.
Code:
const char *s = format;
while (*s != '\0') {
if (*s == '%') {
// read and handle a format specifier
} else {
// print out a literal character
}
++s;
}