if (orig->packet) {
new_frame->packet = malloc(SWITCH_RTP_MAX_BUF_LEN);
+ switch_assert(new_frame->packet);
memcpy(new_frame->packet, orig->packet, orig->packetlen);
new_frame->data = ((unsigned char *)new_frame->packet) + 12;
} else {
}
}
if (!esc) {
- if (*ptr == '\'' && (inside_quotes || ((ptr+1) && strchr(ptr+1, '\'')))) {
+ if (*ptr == '\'' && (inside_quotes || strchr(ptr+1, '\''))) {
if ((inside_quotes = (1 - inside_quotes))) {
end = dest;
}
/* escaped characters are copied verbatim to the destination string */
if (*ptr == ESCAPE_META) {
++ptr;
- } else if (*ptr == '\'' && (inside_quotes || ((ptr+1) && strchr(ptr+1, '\'')))) {
+ } else if (*ptr == '\'' && (inside_quotes || strchr(ptr+1, '\''))) {
inside_quotes = (1 - inside_quotes);
} else if (*ptr == delim && !inside_quotes) {
*ptr = '\0';
if (*buf == '^' && *(buf+1) == '^') {
char *p = buf + 2;
- if (p && *p && *(p+1)) {
+ if (*p && *(p+1)) {
buf = p;
delim = *buf++;
}
int s = 0, r = 0, i;
pfds = calloc(len, sizeof(struct pollfd));
+ switch_assert(pfds);
for (i = 0; i < len; i++) {
if (waitlist[i].sock == SWITCH_SOCK_INVALID) {
const char hex[] = "0123456789ABCDEF";
switch_size_t len = 0;
switch_size_t slen = 0;
- const char *p, *e = end_of_p(url);
+ const char *p, *e;
if (!url) return NULL;
if (!pool) return NULL;
+ e = end_of_p(url);
+
for (p = url; *p; p++) {
int ok = 0;
} else {
ssec = "00";
}
- if (hour && shour) {
+ if (hour) {
*hour = atol(shour);
}
- if (min && smin) {
+ if (min) {
*min = atol(smin);
}
- if (sec && ssec) {
+ if (sec) {
*sec = atol(ssec);
}
*smonth++ = '\0';
if ((sday=strchr(smonth, '-'))) {
*sday++ = '\0';
- if (year && syear) {
+ if (year) {
*year = atol(syear);
}
- if (month && smonth) {
+ if (month) {
*month = atol(smonth);
}
- if (day && sday) {
+ if (day) {
*day = atol(sday);
}
}
while ((cur = _dow_read_token(&p)) != DOW_EOF) {
if (cur == DOW_COMA) {
/* Reset state */
- cur = prev = DOW_EOF;
+ cur = DOW_EOF;
} else if (cur == DOW_HYPHEN) {
/* Save the previous token and move to the next one */
range_start = prev;
}
request->_buffer = strdup(buffer);
+ switch_assert(request->_buffer);
request->method = request->_buffer;
request->bytes_buffered = datalen;
- if (body) {
- request->bytes_header = body - buffer;
- request->bytes_read = body - buffer;
- }
+ request->bytes_header = body - buffer;
+ request->bytes_read = body - buffer;
p = strchr(request->method, ' ');