Fixed %u and %s mixup.
This commit is contained in:
parent
c06aad7cdc
commit
b6f36d4380
1 changed files with 3 additions and 2 deletions
|
@ -218,7 +218,7 @@ int server()
|
||||||
free(bin);
|
free(bin);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (send(c_fd, buf, sizeof buf, 0) == -1) {
|
if (send(c_fd, buf, strlen(buf)+1, 0) == -1) {
|
||||||
perror("send");
|
perror("send");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -253,7 +253,8 @@ int client()
|
||||||
if (status == -1) {
|
if (status == -1) {
|
||||||
report_error(buf, BUFLEN, "parse: failed to parse");
|
report_error(buf, BUFLEN, "parse: failed to parse");
|
||||||
} else if (status == -2) {
|
} else if (status == -2) {
|
||||||
sprintf(buf, "%u%c%u", num1, '+', "0");
|
printf("ZORK\n");
|
||||||
|
sprintf(buf, "%u%c%s", num1, '+', "0");
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf, "%u%c%u", num1, op, num2);
|
sprintf(buf, "%u%c%u", num1, op, num2);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue