diff options
author | Andrew Bartlett <abartlet@samba.org> | 2005-09-21 12:24:41 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:38:38 -0500 |
commit | c44efdaa2242f50d75dd5b800e372dd5586c6deb (patch) | |
tree | 543da228fe555b91b60bcd796e723b7c9628b3f6 /source4/heimdal/lib/asn1/gen_decode.c | |
parent | 8f334f69b5d5fcae4a7b2b70e18b7062c46c719e (diff) | |
download | samba-c44efdaa2242f50d75dd5b800e372dd5586c6deb.tar.gz samba-c44efdaa2242f50d75dd5b800e372dd5586c6deb.tar.bz2 samba-c44efdaa2242f50d75dd5b800e372dd5586c6deb.zip |
r10386: Merge current lorikeet-heimdal into Samba4.
Andrew Bartlett
(This used to be commit 4d2a9a9bc497eae269c24cbf156b43b8588e2f73)
Diffstat (limited to 'source4/heimdal/lib/asn1/gen_decode.c')
-rw-r--r-- | source4/heimdal/lib/asn1/gen_decode.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source4/heimdal/lib/asn1/gen_decode.c b/source4/heimdal/lib/asn1/gen_decode.c index 42ceb37e62..6461a0ada9 100644 --- a/source4/heimdal/lib/asn1/gen_decode.c +++ b/source4/heimdal/lib/asn1/gen_decode.c @@ -34,7 +34,7 @@ #include "gen_locl.h" #include "lex.h" -RCSID("$Id: gen_decode.c,v 1.28 2005/08/23 11:51:25 lha Exp $"); +RCSID("$Id: gen_decode.c,v 1.29 2005/09/21 00:30:37 lha Exp $"); static void decode_primitive (const char *typename, const char *name, const char *forwstr) @@ -396,17 +396,15 @@ decode_type (const char *name, const Type *t, int optional, "%s_tmp = realloc((%s)->val, " " sizeof(*((%s)->val)) * ((%s)->len + 1));\n" "if (%s_tmp == NULL) { %s; }\n" - "(%s)->len++;\n" "(%s)->val = %s_tmp;\n", tmpstr, tmpstr, tmpstr, name, name, tmpstr, tmpstr, name, name, name, - tmpstr, - forwstr, name, name, - tmpstr); + tmpstr, forwstr, + name, tmpstr); - asprintf (&n, "&(%s)->val[(%s)->len-1]", name, name); + asprintf (&n, "&(%s)->val[(%s)->len]", name, name); if (n == NULL) errx(1, "malloc"); asprintf (&sname, "%s_s_of", tmpstr); @@ -414,10 +412,12 @@ decode_type (const char *name, const Type *t, int optional, errx(1, "malloc"); decode_type (n, t->subtype, 0, forwstr, sname); fprintf (codefile, + "(%s)->len++;\n" "len = %s_origlen - ret;\n" "}\n" "ret += %s_oldret;\n" "}\n", + name, tmpstr, tmpstr); free (n); free (sname); |