Eli Zaretskii writes: >> dpyinfo->name_list_element = Fcons (display_name, Qnil); >> if (STRINGP (Vsystem_name)) >> { >> - dpyinfo->w32_id_name = xmalloc (SCHARS (Vinvocation_name) >> - + SCHARS (Vsystem_name) + 2); >> - sprintf (dpyinfo->w32_id_name, "%s@%s", >> - SDATA (Vinvocation_name), SDATA (Vsystem_name)); >> + dpyinfo->w32_id_name = xmalloc (14 + SCHARS (Vsystem_name)); >> + sprintf (dpyinfo->w32_id_name, "GNU Emacs at %s", SDATA (Vsystem_name)); > > Please don't use hard-coded constants, like 14 above, in such cases. > Instead, use sizeof to compute the correct size at compile time from > the string used as format specifier. Thanks. Does the attached look better?