Module: sip-router
Branch: master
Commit: 0a9e22751e3f9c85d81a974ae5c06107f45650a4
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0a9e227…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Jun 11 20:10:57 2009 +0300
core: pvapi - be consistent in pv_printf_s()
- there were cases when no copy was done, therefore no ending '\0'
---
pvapi.c | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/pvapi.c b/pvapi.c
index 72fb48d..dbae078 100644
--- a/pvapi.c
+++ b/pvapi.c
@@ -1116,15 +1116,10 @@ int pv_printf_s(struct sip_msg* msg, pv_elem_p list, str *s)
static int buf_itr = 0;
static char buf[PV_PRINT_BUF_NO][PV_PRINT_BUF_SIZE];
- if (list->next==0 && list->spec.getf==0) {
- *s = list->text;
- return 0;
- } else {
- s->s = buf[buf_itr];
- s->len = PV_PRINT_BUF_SIZE;
- buf_itr = (buf_itr+1)%PV_PRINT_BUF_NO;
- return pv_printf( msg, list, s->s, &s->len);
- }
+ s->s = buf[buf_itr];
+ s->len = PV_PRINT_BUF_SIZE;
+ buf_itr = (buf_itr+1)%PV_PRINT_BUF_NO;
+ return pv_printf( msg, list, s->s, &s->len);
}
/********************************************************