// set the key/value and append the remaining text
char tempbuffer[4096];
strlcpy(tempbuffer, buffer + pos2, sizeof(tempbuffer));
- dpsnprintf(buffer + pos, sizeof(buffer) - pos, "\\%s\\%s%s", key, value, tempbuffer);
+ dpsnprintf(buffer + pos, bufferlength - pos, "\\%s\\%s%s", key, value, tempbuffer);
}
else
{