more experimental work
This commit is contained in:
parent
9dfd8dd453
commit
b7cf0c9497
@ -146,6 +146,7 @@ void chat_system(struct user_record *user) {
|
|||||||
char *input_b;
|
char *input_b;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
int z;
|
int z;
|
||||||
|
int y;
|
||||||
|
|
||||||
if (sshBBS) {
|
if (sshBBS) {
|
||||||
chat_in = STDIN_FILENO;
|
chat_in = STDIN_FILENO;
|
||||||
@ -265,12 +266,14 @@ void chat_system(struct user_record *user) {
|
|||||||
strcpy(readbuffer, partmessage);
|
strcpy(readbuffer, partmessage);
|
||||||
|
|
||||||
len = strlen(readbuffer);
|
len = strlen(readbuffer);
|
||||||
|
y = 0;
|
||||||
for (z = 0;z < len; z++) {
|
for (z = 0;z < len; z++) {
|
||||||
if (readbuffer[z] != '\n') {
|
if (readbuffer[z] != '\n') {
|
||||||
message[z] = readbuffer[z];
|
message[y] = readbuffer[z];
|
||||||
message[z+1] = '\0';
|
message[y+1] = '\0';
|
||||||
|
y++;
|
||||||
} else {
|
} else {
|
||||||
|
y = 0;
|
||||||
// json parse
|
// json parse
|
||||||
jsmn_init(&parser);
|
jsmn_init(&parser);
|
||||||
// we got some data from a client
|
// we got some data from a client
|
||||||
|
Reference in New Issue
Block a user