History

fix error print in p9any negotiation (thanks Kenji Arisawa)

in drawterm/cpu.c, we have if(readstr(fd, buf, sizeof buf) < 0) fatal(1, "cannot read OK in p9any: got %d %s", n, buf); perhaps this is intended to be if((n = readstr(fd, buf, sizeof buf)) < 0) fatal(1, "cannot read OK in p9any: got %d %s", n, buf); but the latter is no help. readstr() returns 0 or -1, and if -1 the buf is not terminated by ‘\0’. therefore these should be simply if(readstr(fd, buf, sizeof buf) < 0) fatal(1, "cannot read OK in p9any”); by the way, how can I debug drawterm. fprint(2,…) is no effect. Kenji Arisawa

cinap_lenrek committed 10 years ago

Commit b86ca0b1 parent b9347941 file · +2 −2Browse files

Unified · Split

cpu.c+2−2
@@ -673,9 +673,9 @@ p9any(int fd) · 672 unmodified lines
673 fatal(1, "cannot write user/domain choice in p9any");673 fatal(1, "cannot write user/domain choice in p9any");
674 if(v2){674 if(v2){
675 if(readstr(fd, buf, sizeof buf) < 0)675 if(readstr(fd, buf, sizeof buf) < 0)
676 fatal(1, "cannot read OK in p9any: got %d %s", n, buf);676 fatal(1, "cannot read OK in p9any");
677 if(memcmp(buf, "OK\0", 3) != 0)677 if(memcmp(buf, "OK\0", 3) != 0)
678 fatal(1, "did not get OK in p9any");678 fatal(1, "did not get OK in p9any: got %s", buf);
679 }679 }
680 genrandom(crand, 2*NONCELEN);680 genrandom(crand, 2*NONCELEN);
681 genrandom(cchal, CHALLEN);681 genrandom(cchal, CHALLEN);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t