summaryrefslogtreecommitdiff
path: root/res/res_pjsip_xpidf_body_generator.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_pjsip_xpidf_body_generator.c')
-rw-r--r--res/res_pjsip_xpidf_body_generator.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/res/res_pjsip_xpidf_body_generator.c b/res/res_pjsip_xpidf_body_generator.c
index b68c9bba6..fba6152b3 100644
--- a/res/res_pjsip_xpidf_body_generator.c
+++ b/res/res_pjsip_xpidf_body_generator.c
@@ -97,6 +97,7 @@ static int xpidf_generate_body_content(void *body, void *data)
}
#define MAX_STRING_GROWTHS 3
+#define XML_PROLOG 39
static void xpidf_to_string(void *body, struct ast_str **str)
{
@@ -105,16 +106,14 @@ static void xpidf_to_string(void *body, struct ast_str **str)
int size;
do {
-
size = pjxpidf_print(pres, ast_str_buffer(*str), ast_str_size(*str));
- if (size < 0) {
+ if (size == XML_PROLOG) {
ast_str_make_space(str, ast_str_size(*str) * 2);
++growths;
- return;
}
- } while (size < 0 && growths < MAX_STRING_GROWTHS);
+ } while (size == XML_PROLOG && growths < MAX_STRING_GROWTHS);
- if (size < 0) {
+ if (size == XML_PROLOG) {
ast_log(LOG_WARNING, "XPIDF body text too large\n");
return;
}