mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-08 13:29:59 -05:00
add a few more gcc warning flags and fix quite a few problems found by doing so
This commit is contained in:
parent
047eb52b52
commit
b7026bf248
99 changed files with 810 additions and 776 deletions
|
|
@ -51,20 +51,29 @@ static char *parse_host(const char *s, uint16_t *ret_port) {
|
|||
if (!(e = strchr(s+1, ']')))
|
||||
return NULL;
|
||||
|
||||
if (e[1] == ':')
|
||||
*ret_port = atoi(e+2);
|
||||
else if (e[1] != 0)
|
||||
if (e[1] == ':') {
|
||||
uint32_t p;
|
||||
|
||||
if (pa_atou(e+2, &p) < 0)
|
||||
return NULL;
|
||||
|
||||
*ret_port = (uint16_t) p;
|
||||
} else if (e[1] != 0)
|
||||
return NULL;
|
||||
|
||||
return pa_xstrndup(s+1, e-s-1);
|
||||
return pa_xstrndup(s+1, (size_t) (e-s-1));
|
||||
} else {
|
||||
char *e;
|
||||
uint32_t p;
|
||||
|
||||
if (!(e = strrchr(s, ':')))
|
||||
return pa_xstrdup(s);
|
||||
|
||||
*ret_port = atoi(e+1);
|
||||
return pa_xstrndup(s, e-s);
|
||||
if (pa_atou(e+1, &p) < 0)
|
||||
return NULL;
|
||||
|
||||
*ret_port = (uint16_t) p;
|
||||
return pa_xstrndup(s, (size_t) (e-s));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue