Fix liveness of buf

So that domain can point to it.
This commit is contained in:
Samuel Thibault 2022-11-03 13:27:51 +01:00
parent 6df96f8148
commit 4d906e595d

View file

@ -4520,12 +4520,12 @@ static void stripdomain(char *host)
{
char *domain = 0;
char _domain[1024];
char buf[1024];
// strip off domain
FILE *resolv = fopen("/etc/resolv.conf", "r");
if (resolv)
{
char buf[1024];
char *b;
while (fgets(buf, sizeof(buf), resolv))