From: H.G. Muller Date: Mon, 15 Nov 2010 10:36:21 +0000 (+0100) Subject: Fix home-dir crash X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=357e76cac0dedc4522e0018b0fb49abbe879c4da;p=xboard.git Fix home-dir crash When confronted with a path name starting with ~ and not containing a / XBoard would segfault. --- 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) {