Changeset 4979
- Timestamp:
- Feb 10, 2015 3:20:04 AM (10 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsip/print_util.h
r4537 r4979 20 20 #ifndef __PJSIP_PRINT_H__ 21 21 #define __PJSIP_PRINT_H__ 22 23 #define copy_advance_char_check(buf,chr) \ 24 do { \ 25 if (1 >= (endbuf-buf)) return -1; \ 26 *buf++ = chr; \ 27 } while (0) 22 28 23 29 #define copy_advance_check(buf,str) \ -
pjproject/trunk/pjsip/src/pjsip/sip_msg.c
r4849 r4979 1221 1221 1222 1222 copy_advance(buf, (*hname)); 1223 *buf++ = ':';1224 *buf++ = ' ';1223 copy_advance_char_check(buf, ':'); 1224 copy_advance_char_check(buf, ' '); 1225 1225 1226 1226 printed = pjsip_uri_print(PJSIP_URI_IN_CONTACT_HDR, hdr->uri, -
pjproject/trunk/pjsip/src/pjsip/sip_uri.c
r4537 r4979 122 122 123 123 do { 124 *buf++ = (char)sep;124 copy_advance_char_check(buf, (char)sep); 125 125 copy_advance_escape(buf, p->name, (*pname_spec)); 126 126 if (p->value.slen) { 127 *buf++ = '=';127 copy_advance_char_check(buf, '='); 128 128 if (*p->value.ptr == '"') 129 129 copy_advance(buf, p->value); … … 266 266 scheme = pjsip_uri_get_scheme(url); 267 267 copy_advance_check(buf, *scheme); 268 *buf++ = ':';268 copy_advance_char_check(buf, ':'); 269 269 270 270 /* Print "user:password@", if any. */ … … 275 275 copy_advance_escape(buf, url->user, *spec); 276 276 if (url->passwd.slen) { 277 *buf++ = ':';277 copy_advance_char_check(buf, ':'); 278 278 copy_advance_escape(buf, url->passwd, pc->pjsip_PASSWD_SPEC); 279 279 } 280 280 281 *buf++ = '@';281 copy_advance_char_check(buf, '@'); 282 282 } 283 283 … … 305 305 return -1; 306 306 307 *buf++ = ':';307 copy_advance_char_check(buf, ':'); 308 308 printed = pj_utoa(url->port, buf); 309 309 buf += printed; … … 567 567 if (context != PJSIP_URI_IN_REQ_URI) { 568 568 if (name->display.slen) { 569 if (endbuf-buf < 8) return -1;570 *buf++ = '"';569 if (endbuf-buf < name->display.slen + 3) return -1; 570 copy_advance_char_check(buf, '"'); 571 571 copy_advance(buf, name->display); 572 *buf++ = '"';573 *buf++ = ' ';572 copy_advance_char_check(buf, '"'); 573 copy_advance_char_check(buf, ' '); 574 574 } 575 *buf++ = '<';575 copy_advance_char_check(buf, '<');; 576 576 } 577 577 … … 582 582 583 583 if (context != PJSIP_URI_IN_REQ_URI) { 584 *buf++ = '>';584 copy_advance_char_check(buf, '>'); 585 585 } 586 586
Note: See TracChangeset
for help on using the changeset viewer.