[pulseaudio-commits] r1534 - in /branches/lennart/src: ./ daemon/ modules/ modules/gconf/ pulse/ pulsecore/

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Wed Jul 25 09:23:04 PDT 2007


Author: lennart
Date: Wed Jul 25 18:23:03 2007
New Revision: 1534

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1534&root=3Dpulseaudio&vi=
ew=3Drev
Log:
Convert most snprintf() calls to pa_snprintf()

Modified:
    branches/lennart/src/Makefile.am
    branches/lennart/src/daemon/cpulimit.c
    branches/lennart/src/daemon/dumpmodules.c
    branches/lennart/src/modules/gconf/gconf-helper.c
    branches/lennart/src/modules/module-combine.c
    branches/lennart/src/modules/module-detect.c
    branches/lennart/src/modules/module-hal-detect.c
    branches/lennart/src/modules/module-sine.c
    branches/lennart/src/modules/module-tunnel.c
    branches/lennart/src/pulse/browser.c
    branches/lennart/src/pulse/channelmap.c
    branches/lennart/src/pulse/context.c
    branches/lennart/src/pulse/sample.c
    branches/lennart/src/pulse/util.c
    branches/lennart/src/pulse/volume.c
    branches/lennart/src/pulsecore/core-scache.c
    branches/lennart/src/pulsecore/core-util.c
    branches/lennart/src/pulsecore/inet_ntop.c
    branches/lennart/src/pulsecore/namereg.c
    branches/lennart/src/pulsecore/pdispatch.c
    branches/lennart/src/pulsecore/pid.c
    branches/lennart/src/pulsecore/protocol-esound.c
    branches/lennart/src/pulsecore/protocol-http.c
    branches/lennart/src/pulsecore/protocol-native.c
    branches/lennart/src/pulsecore/shm.c
    branches/lennart/src/pulsecore/socket-client.c
    branches/lennart/src/pulsecore/socket-server.c
    branches/lennart/src/pulsecore/socket-util.c
    branches/lennart/src/pulsecore/strbuf.c
    branches/lennart/src/pulsecore/x11wrap.c

Modified: branches/lennart/src/Makefile.am
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/Makefile.a=
m?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/Makefile.am (original)
+++ branches/lennart/src/Makefile.am Wed Jul 25 18:23:03 2007
@@ -1292,7 +1292,7 @@
 module_gconf_la_CFLAGS =3D $(AM_CFLAGS) -DPA_GCONF_HELPER=3D\"$(pulselibex=
ecdir)/gconf-helper\"
 =

 gconf_helper_SOURCES =3D modules/gconf/gconf-helper.c
-gconf_helper_LDADD =3D $(AM_LDADD) $(GCONF_LIBS)
+gconf_helper_LDADD =3D $(AM_LDADD) $(GCONF_LIBS) libpulsecore.la
 gconf_helper_CFLAGS =3D $(AM_CFLAGS) $(GCONF_CFLAGS)
 gconf_helper_LDFLAGS =3D $(AM_LDFLAGS) $(BINLDFLAGS)
 =


Modified: branches/lennart/src/daemon/cpulimit.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/daemon/cpu=
limit.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/daemon/cpulimit.c (original)
+++ branches/lennart/src/daemon/cpulimit.c Wed Jul 25 18:23:03 2007
@@ -130,7 +130,7 @@
         time(&now);
 =

 #ifdef PRINT_CPU_LOAD
-        snprintf(t, sizeof(t), "Using %0.1f%% CPU\n", (double)CPUTIME_INTE=
RVAL_SOFT/(now-last_time)*100);
+        pa_snprintf(t, sizeof(t), "Using %0.1f%% CPU\n", (double)CPUTIME_I=
NTERVAL_SOFT/(now-last_time)*100);
         write_err(t);
 #endif
 =


Modified: branches/lennart/src/daemon/dumpmodules.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/daemon/dum=
pmodules.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/daemon/dumpmodules.c (original)
+++ branches/lennart/src/daemon/dumpmodules.c Wed Jul 25 18:23:03 2007
@@ -35,6 +35,7 @@
 #include <pulse/util.h>
 =

 #include <pulsecore/modinfo.h>
+#include <pulsecore/core-util.h>
 =

 #include "dumpmodules.h"
 =

@@ -93,7 +94,7 @@
         if (l->address)
             continue;
 =

-        snprintf(buf, sizeof(buf), "%s", l->name);
+        pa_snprintf(buf, sizeof(buf), "%s", l->name);
         if ((e =3D strrchr(buf, '.')))
             *e =3D 0;
 =

@@ -137,7 +138,7 @@
             if (strlen(l->name) <=3D sizeof(PREFIX)-1 || strncmp(l->name, =
PREFIX, sizeof(PREFIX)-1))
                 continue;
 =

-            snprintf(buf, sizeof(buf), "%s", l->name);
+            pa_snprintf(buf, sizeof(buf), "%s", l->name);
             if ((e =3D strrchr(buf, '.')))
                 *e =3D 0;
 =


Modified: branches/lennart/src/modules/gconf/gconf-helper.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/modules/gc=
onf/gconf-helper.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3D=
diff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/modules/gconf/gconf-helper.c (original)
+++ branches/lennart/src/modules/gconf/gconf-helper.c Wed Jul 25 18:23:03 2=
007
@@ -32,6 +32,8 @@
 #include <gconf/gconf-client.h>
 #include <glib.h>
 =

+#include <pulsecore/core-util.h>
+
 #define PA_GCONF_ROOT "/system/pulseaudio"
 #define PA_GCONF_PATH_MODULES PA_GCONF_ROOT"/modules"
 =

@@ -40,13 +42,13 @@
     gboolean enabled, locked;
     int i;
 =

-    snprintf(p, sizeof(p), PA_GCONF_PATH_MODULES"/%s/locked", name);
+    pa_snprintf(p, sizeof(p), PA_GCONF_PATH_MODULES"/%s/locked", name);
     locked =3D gconf_client_get_bool(client, p, FALSE);
 =

     if (locked)
         return;
 =

-    snprintf(p, sizeof(p), PA_GCONF_PATH_MODULES"/%s/enabled", name);
+    pa_snprintf(p, sizeof(p), PA_GCONF_PATH_MODULES"/%s/enabled", name);
     enabled =3D gconf_client_get_bool(client, p, FALSE);
 =

     printf("%c%s%c", enabled ? '+' : '-', name, 0);
@@ -56,11 +58,11 @@
         for (i =3D 0; i < 10; i++) {
             gchar *n, *a;
 =

-            snprintf(p, sizeof(p), PA_GCONF_PATH_MODULES"/%s/name%i", name=
, i);
+            pa_snprintf(p, sizeof(p), PA_GCONF_PATH_MODULES"/%s/name%i", n=
ame, i);
             if (!(n =3D gconf_client_get_string(client, p, NULL)) || !*n)
                 break;
 =

-            snprintf(p, sizeof(p), PA_GCONF_PATH_MODULES"/%s/args%i", name=
, i);
+            pa_snprintf(p, sizeof(p), PA_GCONF_PATH_MODULES"/%s/args%i", n=
ame, i);
             a =3D gconf_client_get_string(client, p, NULL);
 =

             printf("%s%c%s%c", n, 0, a ? a : "", 0);

Modified: branches/lennart/src/modules/module-combine.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/modules/mo=
dule-combine.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/modules/module-combine.c (original)
+++ branches/lennart/src/modules/module-combine.c Wed Jul 25 18:23:03 2007
@@ -251,7 +251,7 @@
             0,
             NULL);
 =

-    snprintf(t, sizeof(t), "Output stream #%u of sink %s", u->n_outputs+1,=
 u->sink->name);
+    pa_snprintf(t, sizeof(t), "Output stream #%u of sink %s", u->n_outputs=
+1, u->sink->name);
 =

     pa_sink_input_new_data_init(&data);
     data.sink =3D sink;

Modified: branches/lennart/src/modules/module-detect.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/modules/mo=
dule-detect.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/modules/module-detect.c (original)
+++ branches/lennart/src/modules/module-detect.c Wed Jul 25 18:23:03 2007
@@ -96,7 +96,7 @@
         if (subdevice !=3D 0)
             continue;
 =

-        snprintf(args, sizeof(args), "device=3Dhw:%u", device);
+        pa_snprintf(args, sizeof(args), "device=3Dhw:%u", device);
         if (!pa_module_load(c, is_sink ? "module-alsa-sink" : "module-alsa=
-source", args))
             continue;
 =

@@ -148,16 +148,16 @@
 =

         if (sscanf(line, "%u: ", &device) =3D=3D 1) {
             if (device =3D=3D 0)
-                snprintf(args, sizeof(args), "device=3D/dev/dsp");
+                pa_snprintf(args, sizeof(args), "device=3D/dev/dsp");
             else
-                snprintf(args, sizeof(args), "device=3D/dev/dsp%u", device=
);
+                pa_snprintf(args, sizeof(args), "device=3D/dev/dsp%u", dev=
ice);
 =

             if (!pa_module_load(c, "module-oss", args))
                 continue;
 =

         } else if (sscanf(line, "pcm%u: ", &device) =3D=3D 1) {
             /* FreeBSD support, the devices are named /dev/dsp0.0, dsp0.1 =
and so on */
-            snprintf(args, sizeof(args), "device=3D/dev/dsp%u.0", device);
+            pa_snprintf(args, sizeof(args), "device=3D/dev/dsp%u.0", devic=
e);
 =

             if (!pa_module_load(c, "module-oss", args))
                 continue;
@@ -193,7 +193,7 @@
     if (!S_ISCHR(s.st_mode))
         return 0;
 =

-    snprintf(args, sizeof(args), "device=3D%s", dev);
+    pa_snprintf(args, sizeof(args), "device=3D%s", dev);
 =

     if (!pa_module_load(c, "module-solaris", args))
         return 0;

Modified: branches/lennart/src/modules/module-hal-detect.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/modules/mo=
dule-hal-detect.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Dd=
iff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/modules/module-hal-detect.c (original)
+++ branches/lennart/src/modules/module-hal-detect.c Wed Jul 25 18:23:03 20=
07
@@ -182,10 +182,10 @@
 =

     if (type =3D=3D ALSA_TYPE_SINK) {
         module_name =3D "module-alsa-sink";
-        snprintf(args, sizeof(args), "device=3Dhw:%u sink_name=3Dalsa_outp=
ut.%s", card, strip_udi(udi));
+        pa_snprintf(args, sizeof(args), "device=3Dhw:%u sink_name=3Dalsa_o=
utput.%s", card, strip_udi(udi));
     } else {
         module_name =3D "module-alsa-source";
-        snprintf(args, sizeof(args), "device=3Dhw:%u source_name=3Dalsa_in=
put.%s", card, strip_udi(udi));
+        pa_snprintf(args, sizeof(args), "device=3Dhw:%u source_name=3Dalsa=
_input.%s", card, strip_udi(udi));
     }
 =

     pa_log_debug("Loading %s with arguments '%s'", module_name, args);
@@ -244,7 +244,7 @@
     if (!device || dbus_error_is_set(error))
         return NULL;
 =

-    snprintf(args, sizeof(args), "device=3D%s sink_name=3Doss_output.%s so=
urce_name=3Doss_input.%s", device, strip_udi(udi), strip_udi(udi));
+    pa_snprintf(args, sizeof(args), "device=3D%s sink_name=3Doss_output.%s=
 source_name=3Doss_input.%s", device, strip_udi(udi), strip_udi(udi));
     libhal_free_string(device);
 =

     pa_log_debug("Loading module-oss with arguments '%s'", args);

Modified: branches/lennart/src/modules/module-sine.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/modules/mo=
dule-sine.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/modules/module-sine.c (original)
+++ branches/lennart/src/modules/module-sine.c Wed Jul 25 18:23:03 2007
@@ -36,6 +36,7 @@
 #include <pulsecore/modargs.h>
 #include <pulsecore/namereg.h>
 #include <pulsecore/log.h>
+#include <pulsecore/core-util.h>
 =

 #include "module-sine-symdef.h"
 =

@@ -155,7 +156,7 @@
     calc_sine(p, pa_memblock_get_length(u->memblock), frequency);
     pa_memblock_release(u->memblock);
 =

-    snprintf(t, sizeof(t), "Sine Generator at %u Hz", frequency);
+    pa_snprintf(t, sizeof(t), "Sine Generator at %u Hz", frequency);
 =

     pa_sink_input_new_data_init(&data);
     data.sink =3D sink;

Modified: branches/lennart/src/modules/module-tunnel.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/modules/mo=
dule-tunnel.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/modules/module-tunnel.c (original)
+++ branches/lennart/src/modules/module-tunnel.c Wed Jul 25 18:23:03 2007
@@ -596,12 +596,12 @@
     }
 =

 #ifdef TUNNEL_SINK
-    snprintf(name, sizeof(name), "Tunnel from host %s, user %s, sink %s",
+    pa_snprintf(name, sizeof(name), "Tunnel from host %s, user %s, sink %s=
",
              pa_get_host_name(hn, sizeof(hn)),
              pa_get_user_name(un, sizeof(un)),
              u->sink->name);
 #else
-    snprintf(name, sizeof(name), "Tunnel from host %s, user %s, source %s",
+    pa_snprintf(name, sizeof(name), "Tunnel from host %s, user %s, source =
%s",
              pa_get_host_name(hn, sizeof(hn)),
              pa_get_user_name(un, sizeof(un)),
              u->source->name);

Modified: branches/lennart/src/pulse/browser.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulse/brow=
ser.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulse/browser.c (original)
+++ branches/lennart/src/pulse/browser.c Wed Jul 25 18:23:03 2007
@@ -112,10 +112,10 @@
     assert(opcode >=3D 0);
 =

     if (aa->proto =3D=3D AVAHI_PROTO_INET)
-        snprintf(a, sizeof(a), "tcp:%s:%u", avahi_address_snprint(ip, size=
of(ip), aa), port);
+        pa_snprintf(a, sizeof(a), "tcp:%s:%u", avahi_address_snprint(ip, s=
izeof(ip), aa), port);
     else {
         assert(aa->proto =3D=3D AVAHI_PROTO_INET6);
-        snprintf(a, sizeof(a), "tcp6:%s:%u", avahi_address_snprint(ip, siz=
eof(ip), aa), port);
+        pa_snprintf(a, sizeof(a), "tcp6:%s:%u", avahi_address_snprint(ip, =
sizeof(ip), aa), port);
     }
     i.server =3D a;
 =


Modified: branches/lennart/src/pulse/channelmap.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulse/chan=
nelmap.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulse/channelmap.c (original)
+++ branches/lennart/src/pulse/channelmap.c Wed Jul 25 18:23:03 2007
@@ -370,7 +370,7 @@
     *(e =3D s) =3D 0;
 =

     for (channel =3D 0; channel < map->channels && l > 1; channel++) {
-        l -=3D snprintf(e, l, "%s%s",
+        l -=3D pa_snprintf(e, l, "%s%s",
                       first ? "" : ",",
                       pa_channel_position_to_string(map->map[channel]));
 =


Modified: branches/lennart/src/pulse/context.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulse/cont=
ext.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulse/context.c (original)
+++ branches/lennart/src/pulse/context.c Wed Jul 25 18:23:03 2007
@@ -535,7 +535,7 @@
         argv[n++] =3D c->conf->daemon_binary;
         argv[n++] =3D "--daemonize=3Dyes";
 =

-        snprintf(t, sizeof(t), "-Lmodule-native-protocol-fd fd=3D%i", fds[=
1]);
+        pa_snprintf(t, sizeof(t), "-Lmodule-native-protocol-fd fd=3D%i", f=
ds[1]);
         argv[n++] =3D strdup(t);
 =

         while (n < MAX_ARGS) {

Modified: branches/lennart/src/pulse/sample.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulse/samp=
le.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulse/sample.c (original)
+++ branches/lennart/src/pulse/sample.c Wed Jul 25 18:23:03 2007
@@ -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 @@
     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->fo=
rmat), 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 >=3D ((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 >=3D ((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 >=3D (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;
 }

Modified: branches/lennart/src/pulse/util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulse/util=
.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulse/util.c (original)
+++ branches/lennart/src/pulse/util.c Wed Jul 25 18:23:03 2007
@@ -90,7 +90,7 @@
             * that do not support getpwuid_r. */
         if ((r =3D getpwuid(getuid())) =3D=3D NULL) {
 #endif
-            snprintf(s, l, "%lu", (unsigned long) getuid());
+            pa_snprintf(s, l, "%lu", (unsigned long) getuid());
             return s;
         }
 =


Modified: branches/lennart/src/pulse/volume.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulse/volu=
me.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulse/volume.c (original)
+++ branches/lennart/src/pulse/volume.c Wed Jul 25 18:23:03 2007
@@ -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 @@
     *(e =3D s) =3D 0;
 =

     for (channel =3D 0; channel < c->channels && l > 1; channel++) {
-        l -=3D snprintf(e, l, "%s%u: %3u%%",
+        l -=3D pa_snprintf(e, l, "%s%u: %3u%%",
                       first ? "" : " ",
                       channel,
                       (c->values[channel]*100)/PA_VOLUME_NORM);

Modified: branches/lennart/src/pulsecore/core-scache.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
core-scache.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/core-scache.c (original)
+++ branches/lennart/src/pulsecore/core-scache.c Wed Jul 25 18:23:03 2007
@@ -415,7 +415,7 @@
             if (e->d_name[0] =3D=3D '.')
                 continue;
 =

-            snprintf(p, sizeof(p), "%s/%s", pathname, e->d_name);
+            pa_snprintf(p, sizeof(p), "%s/%s", pathname, e->d_name);
             add_file(c, p);
         }
     }

Modified: branches/lennart/src/pulsecore/core-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
core-util.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/core-util.c (original)
+++ branches/lennart/src/pulsecore/core-util.c Wed Jul 25 18:23:03 2007
@@ -431,6 +431,8 @@
         r =3D vsnprintf(c, size, format, ap);
         va_end(ap);
 =

+        c[size-1] =3D 0;
+
         if (r > -1 && r < size)
             return c;
 =

@@ -453,12 +455,13 @@
         int r;
         va_list aq;
 =

+        c =3D pa_xrealloc(c, size);
+
         va_copy(aq, ap);
-
-        c =3D pa_xrealloc(c, size);
         r =3D vsnprintf(c, size, format, aq);
-
         va_end(aq);
+
+        c[size-1] =3D 0;
 =

         if (r > -1 && r < size)
             return c;
@@ -1146,17 +1149,17 @@
     if ((e =3D getenv("PULSE_RUNTIME_PATH"))) {
 =

         if (fn)
-            snprintf(s, l, "%s%c%s", e, PATH_SEP, fn);
+            pa_snprintf(s, l, "%s%c%s", e, PATH_SEP, fn);
         else
-            snprintf(s, l, "%s", e);
+            pa_snprintf(s, l, "%s", e);
 =

     } else {
         char u[256];
 =

         if (fn)
-            snprintf(s, l, "%s%s%c%s", PA_USER_RUNTIME_PATH_PREFIX, pa_get=
_user_name(u, sizeof(u)), PATH_SEP, fn);
+            pa_snprintf(s, l, "%s%s%c%s", PA_USER_RUNTIME_PATH_PREFIX, pa_=
get_user_name(u, sizeof(u)), PATH_SEP, fn);
         else
-            snprintf(s, l, "%s%s", PA_USER_RUNTIME_PATH_PREFIX, pa_get_use=
r_name(u, sizeof(u)));
+            pa_snprintf(s, l, "%s%s", PA_USER_RUNTIME_PATH_PREFIX, pa_get_=
user_name(u, sizeof(u)));
     }
 =

 =


Modified: branches/lennart/src/pulsecore/inet_ntop.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
inet_ntop.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/inet_ntop.c (original)
+++ branches/lennart/src/pulsecore/inet_ntop.c Wed Jul 25 18:23:03 2007
@@ -47,7 +47,7 @@
 =

     switch (af) {
     case AF_INET:
-        snprintf(dst, cnt, "%d.%d.%d.%d",
+        pa_snprintf(dst, cnt, "%d.%d.%d.%d",
 #ifdef WORDS_BIGENDIAN
             (int)(in->s_addr >> 24) & 0xff,
             (int)(in->s_addr >> 16) & 0xff,
@@ -61,7 +61,7 @@
 #endif
         break;
     case AF_INET6:
-        snprintf(dst, cnt, "%x:%x:%x:%x:%x:%x:%x:%x",
+        pa_snprintf(dst, cnt, "%x:%x:%x:%x:%x:%x:%x:%x",
             in6->s6_addr[ 0] << 8 | in6->s6_addr[ 1],
             in6->s6_addr[ 2] << 8 | in6->s6_addr[ 3],
             in6->s6_addr[ 4] << 8 | in6->s6_addr[ 5],

Modified: branches/lennart/src/pulsecore/namereg.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
namereg.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/namereg.c (original)
+++ branches/lennart/src/pulsecore/namereg.c Wed Jul 25 18:23:03 2007
@@ -142,7 +142,7 @@
         k =3D pa_xnew(char, l+4);
 =

         for (i =3D 2; i <=3D 99; i++) {
-            snprintf(k, l+4, "%s.%u", name, i);
+            pa_snprintf(k, l+4, "%s.%u", name, i);
 =

             if (!(e =3D pa_hashmap_get(c->namereg, k)))
                 break;

Modified: branches/lennart/src/pulsecore/pdispatch.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
pdispatch.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/pdispatch.c (original)
+++ branches/lennart/src/pulsecore/pdispatch.c Wed Jul 25 18:23:03 2007
@@ -206,7 +206,7 @@
     char t[256];
     char const *p;
     if (!(p =3D command_names[command]))
-        snprintf((char*) (p =3D t), sizeof(t), "%u", command);
+        pa_snprintf((char*) (p =3D t), sizeof(t), "%u", command);
 =

     pa_log("Recieved opcode <%s>", p);
 }

Modified: branches/lennart/src/pulsecore/pid.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
pid.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/pid.c (original)
+++ branches/lennart/src/pulsecore/pid.c Wed Jul 25 18:23:03 2007
@@ -172,7 +172,7 @@
         goto fail;
     }
 =

-    snprintf(t, sizeof(t), "%lu\n", (unsigned long) getpid());
+    pa_snprintf(t, sizeof(t), "%lu\n", (unsigned long) getpid());
     l =3D strlen(t);
 =

     if (pa_loop_write(fd, t, l, NULL) !=3D (ssize_t) l) {

Modified: branches/lennart/src/pulsecore/protocol-esound.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
protocol-esound.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Dd=
iff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/protocol-esound.c (original)
+++ branches/lennart/src/pulsecore/protocol-esound.c Wed Jul 25 18:23:03 20=
07
@@ -626,7 +626,7 @@
             if (strncmp(ce->name, SCACHE_PREFIX, sizeof(SCACHE_PREFIX)-1) =
=3D=3D 0)
                 strncpy(name, ce->name+sizeof(SCACHE_PREFIX)-1, ESD_NAME_M=
AX);
             else
-                snprintf(name, ESD_NAME_MAX, "native.%s", ce->name);
+                pa_snprintf(name, ESD_NAME_MAX, "native.%s", ce->name);
             connection_write(c, name, ESD_NAME_MAX);
 =

             /* rate */
@@ -1194,7 +1194,7 @@
     pa_iochannel_set_callback(c->io, io_callback, c);
 =

     pa_iochannel_socket_peer_to_string(io, pname, sizeof(pname));
-    snprintf(cname, sizeof(cname), "EsounD client (%s)", pname);
+    pa_snprintf(cname, sizeof(cname), "EsounD client (%s)", pname);
     assert(p->core);
     c->client =3D pa_client_new(p->core, __FILE__, cname);
     assert(c->client);

Modified: branches/lennart/src/pulsecore/protocol-http.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
protocol-http.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/protocol-http.c (original)
+++ branches/lennart/src/pulsecore/protocol-http.c Wed Jul 25 18:23:03 2007
@@ -69,7 +69,7 @@
     assert(msg);
     assert(mime);
 =

-    snprintf(s, sizeof(s),
+    pa_snprintf(s, sizeof(s),
              "HTTP/1.0 %i %s\n"
              "Connection: close\n"
              "Content-Type: %s\n"
@@ -90,7 +90,7 @@
     if (!text)
         text =3D msg;
 =

-    snprintf(s, sizeof(s),
+    pa_snprintf(s, sizeof(s),
              "<?xml version=3D\"1.0\"?>\n"
              "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \=
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"
              "<html xmlns=3D\"http://www.w3.org/1999/xhtml\"><head><title>=
%s</title></head>\n"

Modified: branches/lennart/src/pulsecore/protocol-native.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
protocol-native.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Dd=
iff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/protocol-native.c (original)
+++ branches/lennart/src/pulsecore/protocol-native.c Wed Jul 25 18:23:03 20=
07
@@ -2381,7 +2381,7 @@
     c->version =3D 8;
     c->protocol =3D p;
     pa_iochannel_socket_peer_to_string(io, pname, sizeof(pname));
-    snprintf(cname, sizeof(cname), "Native client (%s)", pname);
+    pa_snprintf(cname, sizeof(cname), "Native client (%s)", pname);
     assert(p->core);
     c->client =3D pa_client_new(p->core, __FILE__, cname);
     assert(c->client);

Modified: branches/lennart/src/pulsecore/shm.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
shm.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/shm.c (original)
+++ branches/lennart/src/pulsecore/shm.c Wed Jul 25 18:23:03 2007
@@ -42,6 +42,7 @@
 #include <pulsecore/core-error.h>
 #include <pulsecore/log.h>
 #include <pulsecore/random.h>
+#include <pulsecore/core-util.h>
 #include <pulse/xmalloc.h>
 =

 #include "shm.h"
@@ -53,7 +54,7 @@
 #define MAX_SHM_SIZE (1024*1024*20)
 =

 static char *segment_name(char *fn, size_t l, unsigned id) {
-    snprintf(fn, l, "/pulse-shm-%u", id);
+    pa_snprintf(fn, l, "/pulse-shm-%u", id);
     return fn;
 }
 =


Modified: branches/lennart/src/pulsecore/socket-client.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
socket-client.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/socket-client.c (original)
+++ branches/lennart/src/pulsecore/socket-client.c Wed Jul 25 18:23:03 2007
@@ -445,7 +445,7 @@
             struct addrinfo hints;
             char port[12];
 =

-            snprintf(port, sizeof(port), "%u", (unsigned) a.port);
+            pa_snprintf(port, sizeof(port), "%u", (unsigned) a.port);
 =

             memset(&hints, 0, sizeof(hints));
             hints.ai_family =3D a.type =3D=3D PA_PARSED_ADDRESS_TCP4 ? PF_=
INET : (a.type =3D=3D PA_PARSED_ADDRESS_TCP6 ? PF_INET6 : PF_UNSPEC);

Modified: branches/lennart/src/pulsecore/socket-server.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
socket-server.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/socket-server.c (original)
+++ branches/lennart/src/pulsecore/socket-server.c Wed Jul 25 18:23:03 2007
@@ -438,14 +438,14 @@
                 if (!pa_get_fqdn(fqdn, sizeof(fqdn)))
                     return NULL;
 =

-                snprintf(c, l, "tcp6:%s:%u", fqdn, (unsigned) ntohs(sa.sin=
6_port));
+                pa_snprintf(c, l, "tcp6:%s:%u", fqdn, (unsigned) ntohs(sa.=
sin6_port));
 =

             } else if (memcmp(&in6addr_loopback, &sa.sin6_addr, sizeof(in6=
addr_loopback)) =3D=3D 0) {
                 char hn[256];
                 if (!pa_get_host_name(hn, sizeof(hn)))
                     return NULL;
 =

-                snprintf(c, l, "{%s}tcp6:localhost:%u", hn, (unsigned) nto=
hs(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 @@
                     return NULL;
                 }
 =

-                snprintf(c, l, "tcp6:[%s]:%u", ip, (unsigned) ntohs(sa.sin=
6_port));
+                pa_snprintf(c, l, "tcp6:[%s]:%u", ip, (unsigned) ntohs(sa.=
sin6_port));
             }
 =

             return c;
@@ -474,13 +474,13 @@
                 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.s=
in_port));
             } else if (sa.sin_addr.s_addr =3D=3D INADDR_LOOPBACK) {
                 char hn[256];
                 if (!pa_get_host_name(hn, sizeof(hn)))
                     return NULL;
 =

-                snprintf(c, l, "{%s}tcp:localhost:%u", hn, (unsigned) ntoh=
s(sa.sin_port));
+                pa_snprintf(c, l, "{%s}tcp:localhost:%u", hn, (unsigned) n=
tohs(sa.sin_port));
             } else {
                 char ip[INET_ADDRSTRLEN];
 =

@@ -489,7 +489,7 @@
                     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.s=
in_port));
 =

             }
 =

@@ -505,7 +505,7 @@
             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;
         }
 =


Modified: branches/lennart/src/pulsecore/socket-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
socket-util.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/socket-util.c (original)
+++ branches/lennart/src/pulsecore/socket-util.c Wed Jul 25 18:23:03 2007
@@ -85,7 +85,7 @@
 =

 #ifndef OS_IS_WIN32
     if (fstat(fd, &st) < 0) {
-        snprintf(c, l, "Invalid client fd");
+        pa_snprintf(c, l, "Invalid client fd");
         return;
     }
 #endif
@@ -108,7 +108,7 @@
             if (sa.sa.sa_family =3D=3D AF_INET) {
                 uint32_t ip =3D ntohl(sa.in.sin_addr.s_addr);
 =

-                snprintf(c, l, "TCP/IP client from %i.%i.%i.%i:%u",
+                pa_snprintf(c, l, "TCP/IP client from %i.%i.%i.%i:%u",
                          ip >> 24,
                          (ip >> 16) & 0xFF,
                          (ip >> 8) & 0xFF,
@@ -121,27 +121,27 @@
 =

                 res =3D inet_ntop(AF_INET6, &sa.in6.sin6_addr, buf, sizeof=
(buf));
                 if (res) {
-                    snprintf(c, l, "TCP/IP client from [%s]:%u", buf, ntoh=
s(sa.in6.sin6_port));
+                    pa_snprintf(c, l, "TCP/IP client from [%s]:%u", buf, n=
tohs(sa.in6.sin6_port));
                     return;
                 }
 #ifdef HAVE_SYS_UN_H
             } else if (sa.sa.sa_family =3D=3D AF_UNIX) {
-                snprintf(c, l, "UNIX socket client");
+                pa_snprintf(c, l, "UNIX socket client");
                 return;
 #endif
             }
 =

         }
 #ifndef OS_IS_WIN32
-        snprintf(c, l, "Unknown network client");
+        pa_snprintf(c, l, "Unknown network client");
         return;
     } else if (S_ISCHR(st.st_mode) && (fd =3D=3D 0 || fd =3D=3D 1)) {
-        snprintf(c, l, "STDIN/STDOUT client");
+        pa_snprintf(c, l, "STDIN/STDOUT client");
         return;
     }
 #endif /* OS_IS_WIN32 */
 =

-    snprintf(c, l, "Unknown client");
+    pa_snprintf(c, l, "Unknown client");
 }
 =

 int pa_socket_low_delay(int fd) {

Modified: branches/lennart/src/pulsecore/strbuf.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
strbuf.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/strbuf.c (original)
+++ branches/lennart/src/pulsecore/strbuf.c Wed Jul 25 18:23:03 2007
@@ -153,6 +153,7 @@
 =

         va_start(ap, format);
         r =3D vsnprintf(CHUNK_TO_TEXT(c), size, format, ap);
+        CHUNK_TO_TEXT(c)[size-1] =3D 0;
         va_end(ap);
 =

         if (r > -1 && r < size) {

Modified: branches/lennart/src/pulsecore/x11wrap.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
x11wrap.c?rev=3D1534&root=3Dpulseaudio&r1=3D1533&r2=3D1534&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/x11wrap.c (original)
+++ branches/lennart/src/pulsecore/x11wrap.c Wed Jul 25 18:23:03 2007
@@ -29,6 +29,7 @@
 #include <pulsecore/llist.h>
 #include <pulsecore/log.h>
 #include <pulsecore/props.h>
+#include <pulsecore/core-util.h>
 =

 #include "x11wrap.h"
 =

@@ -198,7 +199,7 @@
     pa_x11_wrapper *w;
     assert(c);
 =

-    snprintf(t, sizeof(t), "x11-wrapper%s%s", name ? "-" : "", name ? name=
 : "");
+    pa_snprintf(t, sizeof(t), "x11-wrapper%s%s", name ? "-" : "", name ? n=
ame : "");
     if ((w =3D pa_property_get(c, t)))
         return pa_x11_wrapper_ref(w);
 =





More information about the pulseaudio-commits mailing list