char *warning;
unsigned int warning_len;
unsigned int text_len;
- int r;
- int content_len_len;
+ int r;
+ int content_len_len;
char *content_len;
+ char content_len_buf[MAX_CONTENT_LEN_BUF];
char *after_body;
- str to_tag;
+ str to_tag;
char *totags;
received_buf=0;
if (body_len) {
content_len=int2str(body_len, &content_len_len);
+ memcpy(content_len_buf,content_len,content_len_len+1);
+ content_len = content_len_buf;
len += CONTENT_LENGTH_LEN + content_len_len + CRLF_LEN;
- len += body_len;
+ len += body_len;
} else {
len +=CONTENT_LENGTH_LEN+1 + CRLF_LEN;
}
#define WARNING_PHRASE " \"Noisy feedback tells: "
#define WARNING_PHRASE_LEN (sizeof(WARNING_PHRASE)-1)
+#define MAX_CONTENT_LEN_BUF INT2STR_MAX_LEN /* see ut.h/int2str() */
+
#include "parser/msg_parser.h"
#include "ip_addr.h"
}
+#define INT2STR_MAX_LEN 11 /* 10 digits + 0 */
/* returns a pointer to a static buffer containing l in asciiz & sets len */
static inline char* int2str(unsigned int l, int* len)
{
- static char r[11]; /* 10 digits + 0 */
+ static char r[INT2STR_MAX_LEN];
int i;
i=9;