mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
telnetd: fix getremote()
This commit is contained in:
parent
1e7d5833ab
commit
ce825aabe0
1 changed files with 6 additions and 4 deletions
|
@ -66,12 +66,14 @@ getremote(char *dir)
|
|||
int fd, n;
|
||||
char remfile[Maxpath];
|
||||
|
||||
sprint(remfile, "%s/remote", dir);
|
||||
snprint(remfile, sizeof(remfile), "%s/remote", dir);
|
||||
fd = open(remfile, OREAD);
|
||||
if(fd < 0)
|
||||
strcpy(remotesys, "unknown2");
|
||||
if(fd < 0){
|
||||
strcpy(remotesys, remfile);
|
||||
return;
|
||||
}
|
||||
n = read(fd, remotesys, sizeof(remotesys)-1);
|
||||
if(n>0)
|
||||
if(n > 0)
|
||||
remotesys[n-1] = 0;
|
||||
else
|
||||
strcpy(remotesys, remfile);
|
||||
|
|
Loading…
Reference in a new issue