I am trying to break the message into chunks of 32bytes, i am using vsnprintf to print the message. But the args are not incrementing i.e. even after calling vsnprintf the args show the first argument.
#define NOR_LOG_MSG_LENGTH 32
void NOR_LOG_MSG(const char* msg, ...)
{
va_list args;
va_start(args, msg);
uint8_t tempMsgBuf[NOR_LOG_MSG_LENGTH] = { 0 };
int m = vsnprintf((char*)tempMsgBuf, NOR_LOG_MSG_LENGTH, msg, args);
//I want to use rest of the args in next vsnprintf
va_end(args);
}
So, the real question here is, if the vsnprintf increment the args after using it? How should i know how many arguments have been used and how many are left so that i can call va_arg to increment the args?