summaryrefslogtreecommitdiffstats
path: root/src/pulse
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulse')
-rw-r--r--src/pulse/browser.c4
-rw-r--r--src/pulse/channelmap.c2
-rw-r--r--src/pulse/context.c2
-rw-r--r--src/pulse/sample.c13
-rw-r--r--src/pulse/util.c2
-rw-r--r--src/pulse/volume.c3
6 files changed, 14 insertions, 12 deletions
diff --git a/src/pulse/browser.c b/src/pulse/browser.c
index ea2706e4..a35fe810 100644
--- a/src/pulse/browser.c
+++ b/src/pulse/browser.c
@@ -112,10 +112,10 @@ static void resolve_callback(
assert(opcode >= 0);
if (aa->proto == AVAHI_PROTO_INET)
- snprintf(a, sizeof(a), "tcp:%s:%u", avahi_address_snprint(ip, sizeof(ip), aa), port);
+ pa_snprintf(a, sizeof(a), "tcp:%s:%u", avahi_address_snprint(ip, sizeof(ip), aa), port);
else {
assert(aa->proto == AVAHI_PROTO_INET6);
- snprintf(a, sizeof(a), "tcp6:%s:%u", avahi_address_snprint(ip, sizeof(ip), aa), port);
+ pa_snprintf(a, sizeof(a), "tcp6:%s:%u", avahi_address_snprint(ip, sizeof(ip), aa), port);
}
i.server = a;
diff --git a/src/pulse/channelmap.c b/src/pulse/channelmap.c
index d5b8f743..5f1fa95f 100644
--- a/src/pulse/channelmap.c
+++ b/src/pulse/channelmap.c
@@ -370,7 +370,7 @@ char* pa_channel_map_snprint(char *s, size_t l, const pa_channel_map *map) {
*(e = s) = 0;
for (channel = 0; channel < map->channels && l > 1; channel++) {
- l -= snprintf(e, l, "%s%s",
+ l -= pa_snprintf(e, l, "%s%s",
first ? "" : ",",
pa_channel_position_to_string(map->map[channel]));
diff --git a/src/pulse/context.c b/src/pulse/context.c
index 58a5a879..0dba9051 100644
--- a/src/pulse/context.c
+++ b/src/pulse/context.c
@@ -535,7 +535,7 @@ static int context_connect_spawn(pa_context *c) {
argv[n++] = c->conf->daemon_binary;
argv[n++] = "--daemonize=yes";
- snprintf(t, sizeof(t), "-Lmodule-native-protocol-fd fd=%i", fds[1]);
+ pa_snprintf(t, sizeof(t), "-Lmodule-native-protocol-fd fd=%i", fds[1]);
argv[n++] = strdup(t);
while (n < MAX_ARGS) {
diff --git a/src/pulse/sample.c b/src/pulse/sample.c
index ffdeedf7..3d449f53 100644
--- a/src/pulse/sample.c
+++ b/src/pulse/sample.c
@@ -31,6 +31,7 @@
#include <math.h>
#include <string.h>
+#include <pulsecore/core-util.h>
#include "sample.h"
size_t pa_sample_size(const pa_sample_spec *spec) {
@@ -117,22 +118,22 @@ char *pa_sample_spec_snprint(char *s, size_t l, const pa_sample_spec *spec) {
assert(s && l && spec);
if (!pa_sample_spec_valid(spec))
- snprintf(s, l, "Invalid");
+ pa_snprintf(s, l, "Invalid");
else
- snprintf(s, l, "%s %uch %uHz", pa_sample_format_to_string(spec->format), spec->channels, spec->rate);
+ pa_snprintf(s, l, "%s %uch %uHz", pa_sample_format_to_string(spec->format), spec->channels, spec->rate);
return s;
}
char* pa_bytes_snprint(char *s, size_t l, unsigned v) {
if (v >= ((unsigned) 1024)*1024*1024)
- snprintf(s, l, "%0.1f GiB", ((double) v)/1024/1024/1024);
+ pa_snprintf(s, l, "%0.1f GiB", ((double) v)/1024/1024/1024);
else if (v >= ((unsigned) 1024)*1024)
- snprintf(s, l, "%0.1f MiB", ((double) v)/1024/1024);
+ pa_snprintf(s, l, "%0.1f MiB", ((double) v)/1024/1024);
else if (v >= (unsigned) 1024)
- snprintf(s, l, "%0.1f KiB", ((double) v)/1024);
+ pa_snprintf(s, l, "%0.1f KiB", ((double) v)/1024);
else
- snprintf(s, l, "%u B", (unsigned) v);
+ pa_snprintf(s, l, "%u B", (unsigned) v);
return s;
}
diff --git a/src/pulse/util.c b/src/pulse/util.c
index d561329c..c4f2cf78 100644
--- a/src/pulse/util.c
+++ b/src/pulse/util.c
@@ -90,7 +90,7 @@ char *pa_get_user_name(char *s, size_t l) {
* that do not support getpwuid_r. */
if ((r = getpwuid(getuid())) == NULL) {
#endif
- snprintf(s, l, "%lu", (unsigned long) getuid());
+ pa_snprintf(s, l, "%lu", (unsigned long) getuid());
return s;
}
diff --git a/src/pulse/volume.c b/src/pulse/volume.c
index feb33f07..8bba834d 100644
--- a/src/pulse/volume.c
+++ b/src/pulse/volume.c
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <string.h>
+#include <pulsecore/core-util.h>
#include "volume.h"
int pa_cvolume_equal(const pa_cvolume *a, const pa_cvolume *b) {
@@ -125,7 +126,7 @@ char *pa_cvolume_snprint(char *s, size_t l, const pa_cvolume *c) {
*(e = s) = 0;
for (channel = 0; channel < c->channels && l > 1; channel++) {
- l -= snprintf(e, l, "%s%u: %3u%%",
+ l -= pa_snprintf(e, l, "%s%u: %3u%%",
first ? "" : " ",
channel,
(c->values[channel]*100)/PA_VOLUME_NORM);