Avoid snprintf and having buffer on stack.
This commit is contained in:
parent
7bbcec90c4
commit
b0baa839e8
|
@ -623,7 +623,6 @@ error:
|
||||||
*/
|
*/
|
||||||
static nserror cookie_manager_init_common_values(void)
|
static nserror cookie_manager_init_common_values(void)
|
||||||
{
|
{
|
||||||
char buffer[24];
|
|
||||||
const char *temp;
|
const char *temp;
|
||||||
|
|
||||||
/* Set the Restrictions text */
|
/* Set the Restrictions text */
|
||||||
|
@ -645,18 +644,18 @@ static nserror cookie_manager_init_common_values(void)
|
||||||
&cm_ctx.values[CM_NONE], temp);
|
&cm_ctx.values[CM_NONE], temp);
|
||||||
|
|
||||||
/* Set the Cookie version text */
|
/* Set the Cookie version text */
|
||||||
snprintf(buffer, sizeof(buffer), "TreeVersion%i", COOKIE_NETSCAPE);
|
assert(COOKIE_NETSCAPE == 0);
|
||||||
temp = messages_get(buffer);
|
temp = messages_get("TreeVersion0");
|
||||||
cookie_manager_field_builder(CM_VERSION,
|
cookie_manager_field_builder(CM_VERSION,
|
||||||
&cm_ctx.values[CM_NETSCAPE], temp);
|
&cm_ctx.values[CM_NETSCAPE], temp);
|
||||||
|
|
||||||
snprintf(buffer, sizeof(buffer), "TreeVersion%i", COOKIE_RFC2109);
|
assert(COOKIE_RFC2109 == 1);
|
||||||
temp = messages_get(buffer);
|
temp = messages_get("TreeVersion1");
|
||||||
cookie_manager_field_builder(CM_VERSION,
|
cookie_manager_field_builder(CM_VERSION,
|
||||||
&cm_ctx.values[CM_RFC2109], temp);
|
&cm_ctx.values[CM_RFC2109], temp);
|
||||||
|
|
||||||
snprintf(buffer, sizeof(buffer), "TreeVersion%i", COOKIE_RFC2965);
|
assert(COOKIE_RFC2965 == 2);
|
||||||
temp = messages_get(buffer);
|
temp = messages_get("TreeVersion2");
|
||||||
cookie_manager_field_builder(CM_VERSION,
|
cookie_manager_field_builder(CM_VERSION,
|
||||||
&cm_ctx.values[CM_RFC2965], temp);
|
&cm_ctx.values[CM_RFC2965], temp);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue