1
0
Fork 0
mirror of git://git.psyc.eu/libpsyc synced 2024-08-15 03:19:02 +00:00
This commit is contained in:
tg(x) 2011-04-25 14:46:14 +02:00
parent 14a62b568e
commit a6a2512af7

View file

@ -10,12 +10,12 @@ inline int PSYC_renderModifier(PSYC_Modifier *m, char *buffer)
cur += m->name.length; cur += m->name.length;
if (m->flag == PSYC_MODIFIER_NEED_LENGTH) if (m->flag == PSYC_MODIFIER_NEED_LENGTH)
{ {
memcpy(buffer + cur++, " ", 1); buffer[cur++] = ' ';
cur += sprintf(buffer + cur, "%ld", m->value.length); cur += sprintf(buffer + cur, "%ld", m->value.length);
} }
memcpy(buffer + cur, m->value.ptr, m->value.length); memcpy(buffer + cur, m->value.ptr, m->value.length);
cur += m->value.length; cur += m->value.length;
memcpy(buffer + cur++, "\n", 1); buffer[cur++] = '\n';
return cur; return cur;
} }
@ -33,7 +33,7 @@ PSYC_RenderRC PSYC_render(PSYC_Packet *packet, char *buffer, size_t buflen)
if (packet->flag == PSYC_PACKET_NEED_LENGTH) if (packet->flag == PSYC_PACKET_NEED_LENGTH)
cur += sprintf(buffer + cur, "%ld", packet->contentLength); cur += sprintf(buffer + cur, "%ld", packet->contentLength);
memcpy(buffer + cur++, "\n", 1); buffer[cur++] = '\n';
for (i = 0; i < packet->entity.lines; i++) for (i = 0; i < packet->entity.lines; i++)
cur += PSYC_renderModifier(packet->entity.modifiers[i], buffer + cur); cur += PSYC_renderModifier(packet->entity.modifiers[i], buffer + cur);