if (pw != NULL) (void) strcpy (dest, pw->pw_dir); else
if (pw != NULL) { (void) strncpy (dest, pw->pw_dir, len-1); dest[len-1] = '\0'; } else
static String GetRootDirName(dest, len)    String dest;    int len; {#ifdef WIN32    register char *ptr;    if (ptr = getenv("HOME")) {	(void) strncpy(dest, ptr, len);	dest[len-1] = '\0';    } else if (ptr = getenv("USERNAME")) {	(void) strcpy (dest, "/users/");	(void) strncat (dest, ptr, len - strlen (dest));	dest[len-1] = '\0';    } else	*dest = '\0';#else    _Xgetpwparams pwparams;    struct passwd *pw;    static char *ptr;    if ((ptr = getenv("HOME"))) {	(void) strncpy (dest, ptr, len);	dest[len-1] = '\0';    } else {	if (ptr = getenv("USER"))	    pw = _XGetpwnam(ptr,pwparams);	else 	    pw = _XGetpwuid(getuid(),pwparams);	if (pw != NULL)	    (void) strcpy (dest, pw->pw_dir);	else	    *dest = '\0';    }#endif    return dest;}