mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-23 06:59:53 -05:00
Convert most snprintf() calls to pa_snprintf()
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1534 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
8e83838154
commit
929526de33
30 changed files with 79 additions and 67 deletions
|
|
@ -438,14 +438,14 @@ char *pa_socket_server_get_address(pa_socket_server *s, char *c, size_t l) {
|
|||
if (!pa_get_fqdn(fqdn, sizeof(fqdn)))
|
||||
return NULL;
|
||||
|
||||
snprintf(c, l, "tcp6:%s:%u", fqdn, (unsigned) ntohs(sa.sin6_port));
|
||||
pa_snprintf(c, l, "tcp6:%s:%u", fqdn, (unsigned) ntohs(sa.sin6_port));
|
||||
|
||||
} else if (memcmp(&in6addr_loopback, &sa.sin6_addr, sizeof(in6addr_loopback)) == 0) {
|
||||
char hn[256];
|
||||
if (!pa_get_host_name(hn, sizeof(hn)))
|
||||
return NULL;
|
||||
|
||||
snprintf(c, l, "{%s}tcp6:localhost:%u", hn, (unsigned) ntohs(sa.sin6_port));
|
||||
pa_snprintf(c, l, "{%s}tcp6:localhost:%u", hn, (unsigned) ntohs(sa.sin6_port));
|
||||
} else {
|
||||
char ip[INET6_ADDRSTRLEN];
|
||||
|
||||
|
|
@ -454,7 +454,7 @@ char *pa_socket_server_get_address(pa_socket_server *s, char *c, size_t l) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
snprintf(c, l, "tcp6:[%s]:%u", ip, (unsigned) ntohs(sa.sin6_port));
|
||||
pa_snprintf(c, l, "tcp6:[%s]:%u", ip, (unsigned) ntohs(sa.sin6_port));
|
||||
}
|
||||
|
||||
return c;
|
||||
|
|
@ -474,13 +474,13 @@ char *pa_socket_server_get_address(pa_socket_server *s, char *c, size_t l) {
|
|||
if (!pa_get_fqdn(fqdn, sizeof(fqdn)))
|
||||
return NULL;
|
||||
|
||||
snprintf(c, l, "tcp:%s:%u", fqdn, (unsigned) ntohs(sa.sin_port));
|
||||
pa_snprintf(c, l, "tcp:%s:%u", fqdn, (unsigned) ntohs(sa.sin_port));
|
||||
} else if (sa.sin_addr.s_addr == INADDR_LOOPBACK) {
|
||||
char hn[256];
|
||||
if (!pa_get_host_name(hn, sizeof(hn)))
|
||||
return NULL;
|
||||
|
||||
snprintf(c, l, "{%s}tcp:localhost:%u", hn, (unsigned) ntohs(sa.sin_port));
|
||||
pa_snprintf(c, l, "{%s}tcp:localhost:%u", hn, (unsigned) ntohs(sa.sin_port));
|
||||
} else {
|
||||
char ip[INET_ADDRSTRLEN];
|
||||
|
||||
|
|
@ -489,7 +489,7 @@ char *pa_socket_server_get_address(pa_socket_server *s, char *c, size_t l) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
snprintf(c, l, "tcp:[%s]:%u", ip, (unsigned) ntohs(sa.sin_port));
|
||||
pa_snprintf(c, l, "tcp:[%s]:%u", ip, (unsigned) ntohs(sa.sin_port));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -505,7 +505,7 @@ char *pa_socket_server_get_address(pa_socket_server *s, char *c, size_t l) {
|
|||
if (!pa_get_host_name(hn, sizeof(hn)))
|
||||
return NULL;
|
||||
|
||||
snprintf(c, l, "{%s}unix:%s", hn, s->filename);
|
||||
pa_snprintf(c, l, "{%s}unix:%s", hn, s->filename);
|
||||
return c;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue