diff options
Diffstat (limited to 'libxo/libxo.c')
-rw-r--r-- | libxo/libxo.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libxo/libxo.c b/libxo/libxo.c index cceebfa3a3d7..bae810f179c7 100644 --- a/libxo/libxo.c +++ b/libxo/libxo.c @@ -3374,6 +3374,15 @@ xo_buf_append_div (xo_handle_t *xop, const char *class, xo_xff_flags_t flags, static char div_end[] = "\">"; static char div_close[] = "</div>"; + /* The encoding format defaults to the normal format */ + if (encoding == NULL) { + char *enc = alloca(vlen + 1); + memcpy(enc, value, vlen); + enc[vlen] = '\0'; + encoding = xo_fix_encoding(xop, enc); + elen = strlen(encoding); + } + /* * To build our XPath predicate, we need to save the va_list before * we format our data, and then restore it before we format the @@ -3406,15 +3415,6 @@ xo_buf_append_div (xo_handle_t *xop, const char *class, xo_xff_flags_t flags, else xo_buf_append(pbp, "='", 2); - /* The encoding format defaults to the normal format */ - if (encoding == NULL) { - char *enc = alloca(vlen + 1); - memcpy(enc, value, vlen); - enc[vlen] = '\0'; - encoding = xo_fix_encoding(xop, enc); - elen = strlen(encoding); - } - xo_xff_flags_t pflags = flags | XFF_XML | XFF_ATTR; pflags &= ~(XFF_NO_OUTPUT | XFF_ENCODE_ONLY); xo_do_format_field(xop, pbp, encoding, elen, pflags); |