diff options
author | rsc <devnull@localhost> | 2005-02-08 20:35:31 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-02-08 20:35:31 +0000 |
commit | b7edc22192e7ae88584a14e8878fef9248d2b8a4 (patch) | |
tree | 4628559e8d801279ea5ac66d60321a69a81496a1 /src | |
parent | 5fc55a953e9dcd895d9be01c528f329e8dfc685e (diff) | |
download | plan9port-b7edc22192e7ae88584a14e8878fef9248d2b8a4.tar.gz plan9port-b7edc22192e7ae88584a14e8878fef9248d2b8a4.tar.bz2 plan9port-b7edc22192e7ae88584a14e8878fef9248d2b8a4.zip |
send nul with choice
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd/factotum/p9any.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/cmd/factotum/p9any.c b/src/cmd/factotum/p9any.c index 971c7e50..388ee388 100644 --- a/src/cmd/factotum/p9any.c +++ b/src/cmd/factotum/p9any.c @@ -35,7 +35,7 @@ hasnul(void *v, int n) if(n > 0 && c[n-1] == '\0') return n; else - return n+1; + return AuthRpcMax; } static int @@ -220,10 +220,14 @@ found: /* f[i] is the chosen protocol, q the chosen domain */ attr = addattr(attr, "proto=%q dom=%q", f[i], q); c->state = "write choice"; + /* have a key: go for it */ - if(convprint(c, "%q %q", f[i], q) < 0 - || convwrite(c, "\0", 1) < 0) + s = estrappend(nil, "%q %q", f[i], q); + if(convwrite(c, s, strlen(s)+1) < 0){ + free(s); goto out; + } + free(s); if(version == 2){ c->state = "read ok"; |