static char *
make_id_equals_comment (STRUCT_UTMP const *utmp_ent)
{
- char const *ideq = _("id=");
- char const *ut_id = UT_ID (utmp_ent);
- size_t ideqlen = strlen (ideq);
- size_t ut_idlen = strnlen (ut_id, sizeof UT_ID (utmp_ent));
- char *comment = xmalloc (ideqlen + ut_idlen + 1);
- char *rhs = mempcpy (comment, ideq, ideqlen);
- char *z = mempcpy (rhs, ut_id, ut_idlen);
- *z = '\0';
+ size_t utmpsize = sizeof UT_ID (utmp_ent);
+ char *comment = xmalloc (strlen (_("id=")) + utmpsize + 1);
+
+ strcpy (comment, _("id="));
+ strncat (comment, UT_ID (utmp_ent), utmpsize);
return comment;
}