Fixed %u and %s mixup.

This commit is contained in:
tim.schubert@tu-bs.de 2016-10-28 19:09:10 +02:00
parent c06aad7cdc
commit b6f36d4380

View file

@ -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);
} }