(TChoice): add () to make sure variable expression is evaluated correctly
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15646 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -411,11 +411,11 @@ encode_type (const char *name, const Type *t)
|
||||
if (have_ellipsis) {
|
||||
fprintf(codefile,
|
||||
"case %s: {\n"
|
||||
"if (len < %s->u.%s.length)\n"
|
||||
"if (len < (%s)->u.%s.length)\n"
|
||||
"return ASN1_OVERFLOW;\n"
|
||||
"p -= %s->u.%s.length;\n"
|
||||
"ret += %s->u.%s.length;\n"
|
||||
"memcpy(p + 1, %s->u.%s.data, %s->u.%s.length);\n"
|
||||
"p -= (%s)->u.%s.length;\n"
|
||||
"ret += (%s)->u.%s.length;\n"
|
||||
"memcpy(p + 1, (%s)->u.%s.data, (%s)->u.%s.length);\n"
|
||||
"break;\n"
|
||||
"}\n",
|
||||
have_ellipsis->label,
|
||||
|
@@ -171,7 +171,7 @@ length_type (const char *name, const Type *t, const char *variable)
|
||||
if (have_ellipsis)
|
||||
fprintf(codefile,
|
||||
"case %s:\n"
|
||||
"ret += %s->u.%s.length;\n"
|
||||
"ret += (%s)->u.%s.length;\n"
|
||||
"break;\n",
|
||||
have_ellipsis->label,
|
||||
name,
|
||||
|
Reference in New Issue
Block a user