From 357e76cac0dedc4522e0018b0fb49abbe879c4da Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 15 Nov 2010 11:36:21 +0100 Subject: [PATCH] Fix home-dir crash When confronted with a path name starting with ~ and not containing a / XBoard would segfault. --- xboard.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/xboard.c b/xboard.c index 2e8a773..3050105 100644 --- a/xboard.c +++ b/xboard.c @@ -7621,7 +7621,7 @@ ExpandPathName(path) } else { safeStrCpy(buf, s+1, sizeof(buf)/sizeof(buf[0]) ); - *strchr(buf, '/') = 0; + { char *p; if(p = strchr(buf, '/')) *p = 0; } pwd = getpwnam(buf); if (!pwd) { -- 1.7.0.4