sync with Plan 9

This commit is contained in:
Russ Cox 2006-11-13 03:23:32 +00:00
parent bf7b4c49fb
commit a85fefcc92
1 changed files with 2 additions and 3 deletions

View File

@ -196,7 +196,8 @@ mntversion(Chan *c, char *version, int msize, int returnlen)
error("server tries to increase msize in fversion"); error("server tries to increase msize in fversion");
if(f.msize<256 || f.msize>1024*1024) if(f.msize<256 || f.msize>1024*1024)
error("nonsense value of msize in fversion"); error("nonsense value of msize in fversion");
if(strncmp(f.version, v, strlen(f.version)) != 0) k = strlen(f.version);
if(strncmp(f.version, v, k) != 0)
error("bad 9P version returned from server"); error("bad 9P version returned from server");
/* now build Mnt associated with this connection */ /* now build Mnt associated with this connection */
@ -220,7 +221,6 @@ mntversion(Chan *c, char *version, int msize, int returnlen)
m->msize = f.msize; m->msize = f.msize;
unlock(&mntalloc.lk); unlock(&mntalloc.lk);
k = strlen(f.version);
if(returnlen > 0){ if(returnlen > 0){
if(returnlen < k) if(returnlen < k)
error(Eshort); error(Eshort);
@ -242,7 +242,6 @@ mntversion(Chan *c, char *version, int msize, int returnlen)
poperror(); /* c */ poperror(); /* c */
qunlock(&c->umqlock); qunlock(&c->umqlock);
free(msg);
return k; return k;
} }