Aviod seg fault when no file
This commit is contained in:
parent
c7c29d26b7
commit
21c4c72798
@ -12,7 +12,10 @@ void
|
|||||||
setname(File *f)
|
setname(File *f)
|
||||||
{
|
{
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
if(f)
|
||||||
snprint(buf, sizeof buf, "%.*S", f->name.n, f->name.s);
|
snprint(buf, sizeof buf, "%.*S", f->name.n, f->name.s);
|
||||||
|
else
|
||||||
|
buf[0] = 0;
|
||||||
putenv("samfile", buf);
|
putenv("samfile", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user