- char const *host = SSDATA (Vsystem_name);
- ptrdiff_t pathsize = (strlen (home) + sizeof xdefaults
- + SBYTES (Vsystem_name));
- path = xrealloc (home, pathsize);
- strcat (strcat (path, xdefaults), host);
- p = path;
+ ptrdiff_t homelen = strlen (home);
+ Lisp_Object system_name = Fsystem_name ();
+ ptrdiff_t filenamesize = (homelen + sizeof xdefaults
+ + SBYTES (system_name));
+ p = filename = xrealloc (home, filenamesize);
+ lispstpcpy (stpcpy (filename + homelen, xdefaults), system_name);