/*! \brief get_msg_text: Get text out of a SIP MESSAGE packet ---*/ static int get_msg_text(char *buf, int len, struct sip_request *req) { int x; int y; buf[0] = '\0'; y = len - strlen(buf) - 5; if (y < 0) y = 0; for (x=0;xlines;x++) { strncat(buf, req->line[x], y); /* safe */ y -= strlen(req->line[x]) + 1; if (y < 0) y = 0; if (y != 0) strcat(buf, "\n"); /* safe */ } return 0; }