don't write to string constants

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9475 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
2001-01-17 10:09:16 +00:00
parent 9d20072cae
commit 63941620b2

View File

@@ -601,6 +601,7 @@ find_auth_cookie (FILE *f)
Xauth *ret = NULL;
char local_hostname[MaxHostNameLen];
char *display = getenv("DISPLAY");
char d[MaxHostNameLen + 4];
char *colon;
struct addrinfo *ai;
struct addrinfo hints;
@@ -609,6 +610,8 @@ find_auth_cookie (FILE *f)
if(display == NULL)
display = ":0";
strlcpy(d, display, sizeof(d));
display = d;
colon = strchr (display, ':');
if (colon == NULL)
disp = 0;