[pulseaudio-commits] r1436 - in /trunk/src/pulsecore: cli-command.c cli-text.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Tue Mar 6 07:47:12 PST 2007
Author: ossman
Date: Tue Mar 6 16:47:11 2007
New Revision: 1436
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1436&root=3Dpulseaudio&vi=
ew=3Drev
Log:
Fix some instances where we printed a string without first checking that
the pointer was valid.
Modified:
trunk/src/pulsecore/cli-command.c
trunk/src/pulsecore/cli-text.c
Modified: trunk/src/pulsecore/cli-command.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/cli-command=
.c?rev=3D1436&root=3Dpulseaudio&r1=3D1435&r2=3D1436&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
--- trunk/src/pulsecore/cli-command.c (original)
+++ trunk/src/pulsecore/cli-command.c Tue Mar 6 16:47:11 2007
@@ -246,6 +246,7 @@
char s[256];
const pa_mempool_stat *stat;
unsigned k;
+ const char *def_sink, *def_source;
=
static const char* const type_table[PA_MEMBLOCK_TYPE_MAX] =3D {
[PA_MEMBLOCK_POOL] =3D "POOL",
@@ -283,10 +284,12 @@
pa_strbuf_printf(buf, "Default sample spec: %s\n",
pa_sample_spec_snprint(s, sizeof(s), &c->default_samp=
le_spec));
=
+ def_sink =3D pa_namereg_get_default_sink_name(c);
+ def_source =3D pa_namereg_get_default_source_name(c);
pa_strbuf_printf(buf, "Default sink name: %s\n"
"Default source name: %s\n",
- pa_namereg_get_default_sink_name(c),
- pa_namereg_get_default_source_name(c));
+ def_sink ? def_sink : "none",
+ def_source ? def_source : "none");
=
for (k =3D 0; k < PA_MEMBLOCK_TYPE_MAX; k++)
pa_strbuf_printf(buf,
Modified: trunk/src/pulsecore/cli-text.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/cli-text.c?=
rev=3D1436&root=3Dpulseaudio&r1=3D1435&r2=3D1436&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
--- trunk/src/pulsecore/cli-text.c (original)
+++ trunk/src/pulsecore/cli-text.c Tue Mar 6 16:47:11 2007
@@ -55,8 +55,15 @@
=
pa_strbuf_printf(s, "%u module(s) loaded.\n", pa_idxset_size(c->module=
s));
=
- for (m =3D pa_idxset_first(c->modules, &idx); m; m =3D pa_idxset_next(=
c->modules, &idx))
- pa_strbuf_printf(s, " index: %u\n\tname: <%s>\n\targument: <%s>=
\n\tused: %i\n\tauto unload: %s\n", m->index, m->name, m->argument, m->n_us=
ed, m->auto_unload ? "yes" : "no");
+ for (m =3D pa_idxset_first(c->modules, &idx); m; m =3D pa_idxset_next(=
c->modules, &idx)) {
+ pa_strbuf_printf(s, " index: %u\n"
+ "\tname: <%s>\n"
+ "\targument: <%s>\n"
+ "\tused: %i\n"
+ "\tauto unload: %s\n",
+ m->index, m->name, m->argument ? m->argument : "", m->n_used,
+ m->auto_unload ? "yes" : "no");
+ }
=
return pa_strbuf_tostring_free(s);
}
@@ -337,7 +344,7 @@
e->type =3D=3D PA_NAMEREG_SOURCE ? "source" : "sink",
e->index,
e->module,
- e->argument);
+ e->argument ? e->argument : "");
=
}
}
More information about the pulseaudio-commits
mailing list