From edac424073092fda118fb8514ad524d3a66a9ae6 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 29 Mar 2005 23:41:03 +0000 Subject: [BZ #661] 2005-03-19 Bruno Haible * intl/dcigettext.c (struct known_translation_t): Change type of domainname field to 'const char *'. (DCIGETTEXT): Remove const-cast. [BZ #661] * grp/initgroups.c (internal_getgrouplist): Check if we have enough space before adding the primary group to the list. --- intl/dcigettext.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'intl/dcigettext.c') diff --git a/intl/dcigettext.c b/intl/dcigettext.c index 75762ea..8163064 100644 --- a/intl/dcigettext.c +++ b/intl/dcigettext.c @@ -177,7 +177,7 @@ static void *mempcpy PARAMS ((void *dest, const void *src, size_t n)); struct known_translation_t { /* Domain in which to search. */ - char *domainname; + const char *domainname; /* The category. */ int category; @@ -436,7 +436,7 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category) search = (struct known_translation_t *) alloca (offsetof (struct known_translation_t, msgid) + msgid_len); memcpy (search->msgid, msgid1, msgid_len); - search->domainname = (char *) domainname; + search->domainname = domainname; search->category = category; /* Since tfind/tsearch manage a balanced tree, concurrent tfind and @@ -632,9 +632,11 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category) + msgid_len + domainname_len + 1); if (newp != NULL) { - newp->domainname = - mempcpy (newp->msgid, msgid1, msgid_len); - memcpy (newp->domainname, domainname, domainname_len + 1); + char *new_domainname; + + new_domainname = mempcpy (newp->msgid, msgid1, msgid_len); + memcpy (new_domainname, domainname, domainname_len + 1); + newp->domainname = new_domainname; newp->category = category; newp->counter = _nl_msg_cat_cntr; newp->domain = domain; -- cgit v1.1