mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
ggettext: add some comments
Coverity has improperly flagged this code as an instance of CWE-562. The code is fine, but it's confusing, and humans are likely to wind up examining it again in the future, so add some comments to explain what's up.
This commit is contained in:
parent
12fcbcfa41
commit
343081becc
@ -237,6 +237,10 @@ g_dpgettext (const gchar *domain,
|
||||
|
||||
translation = g_dgettext (domain, tmp);
|
||||
|
||||
/* g_dgettext() may return the value we pass to it, which will be on
|
||||
* this stack frame since we allocated it with g_alloca(). If so, we
|
||||
* return a pointer into our original input instead.
|
||||
*/
|
||||
if (translation == tmp)
|
||||
return sep + 1;
|
||||
}
|
||||
@ -294,6 +298,10 @@ g_dpgettext2 (const gchar *domain,
|
||||
msg_ctxt_id[msgctxt_len - 1] = '|';
|
||||
translation = g_dgettext (domain, msg_ctxt_id);
|
||||
|
||||
/* g_dgettext() may return the value we pass to it, which will be on this
|
||||
* stack frame since we allocated it with g_alloca(). If so, we return our
|
||||
* original input instead.
|
||||
*/
|
||||
if (translation == msg_ctxt_id)
|
||||
return msgid;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user