10 lines
262 B
Text
10 lines
262 B
Text
|
|
char buf[512];
|
|
char *current = buf;
|
|
const char *const end = buf + sizeof(buf);
|
|
for (struct item *it = data; it->key; ++it) {
|
|
snprintf(current, end - current, "%s%s=%d",
|
|
current == buf ? "" : ", ", it->key, it->value);
|
|
current += strlen(current);
|
|
}
|
|
|