mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-24 11:41:58 +00:00
Aviod seg fault when no file
This commit is contained in:
parent
c7c29d26b7
commit
21c4c72798
1 changed files with 4 additions and 1 deletions
|
@ -12,7 +12,10 @@ void
|
|||
setname(File *f)
|
||||
{
|
||||
char buf[1024];
|
||||
snprint(buf, sizeof buf, "%.*S", f->name.n, f->name.s);
|
||||
if(f)
|
||||
snprint(buf, sizeof buf, "%.*S", f->name.n, f->name.s);
|
||||
else
|
||||
buf[0] = 0;
|
||||
putenv("samfile", buf);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue