diff options
Diffstat (limited to 'choose.c')
-rw-r--r-- | choose.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -145,6 +145,7 @@ GetSessionNames(int *count_ret, String **short_names_ret, { char *host = ((char *) strchr (id, '/')) + 1; char *colon = (char *) strrchr (host, ':'); + char *lockmsg; /* backtrack over previous colon if there are 2 (DECnet), but not three (IPv6) */ @@ -153,11 +154,8 @@ GetSessionNames(int *count_ret, String **short_names_ret, *colon = '\0'; - (*long_names_ret)[*count_ret] = - XtMalloc (strlen (name) + strlen (host) + 14); - - sprintf ((*long_names_ret)[*count_ret], - "%s (locked at %s)", name, host); + XtAsprintf (&lockmsg, "%s (locked at %s)", name, host); + (*long_names_ret)[*count_ret] = lockmsg; *colon = ':'; XtFree (id); |