I wanted to update _snprintf to secure version but couldn't do it so i wanted to ask here
char itemlink[256];
int len;
bool isAttr = false;
len = _snprintf_s(itemlink, sizeof(itemlink), "item:%x:%x:%x:%x:%x",
htoi(results[1].c_str()),
htoi(results[2].c_str()),
htoi(results[3].c_str()),
htoi(results[4].c_str()),
htoi(results[5].c_str()));
if (results.size() >= 8)
{
for (int i = 6; i < results.size(); i += 2)
{
len += _snprintf(itemlink + len, sizeof(itemlink) - len, ":%x:%d", // here is the part i want to update. i guess it has something to do with +/- len
htoi(results[i].c_str()),
atoi(results[i+1].c_str()));
isAttr = true;
}
}