more experimentation

This commit is contained in:
Andrew Pamment 2016-04-22 15:11:00 +10:00
parent 8c47224077
commit 621fc7ed18

View File

@ -820,13 +820,18 @@ void read_message(int socket, struct user_record *user, struct msg_headers *msgh
ansi = z; ansi = z;
while (strchr("ABCDEFGHIGJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", body[z]) == NULL) while (strchr("ABCDEFGHIGJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", body[z]) == NULL)
z++; z++;
if (body[z] == 'm' || body[z] == 'C' || body[z] == 'B' || body[z] == 'D' || body[z] == 'A') { if (body[z] == 'm' || body[z] == 'C' || body[z] == 'B' || body[z] == 'D') {
strncpy(buffer, &body[ansi], (z - ansi) + 1); strncpy(buffer, &body[ansi], (z - ansi) + 1);
buffer[z - ansi + 1] = '\0'; buffer[z - ansi + 1] = '\0';
s_putstring(socket, buffer); s_putstring(socket, buffer);
} }
if (body[z] == 'A') { if (body[z] == 'A') {
lines -= atoi(&body[ansi + 2]); if (lines >= atoi(&body[ansi + 2])) {
lines -= atoi(&body[ansi + 2]);
strncpy(buffer, &body[ansi], (z - ansi) + 1);
buffer[z - ansi + 1] = '\0';
s_putstring(socket, buffer);
}
} }
if (body[z] == 'C') { if (body[z] == 'C') {
chars += atoi(&body[ansi + 2]); chars += atoi(&body[ansi + 2]);