summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/cli-command.c
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2007-03-06 15:47:11 +0000
committerPierre Ossman <ossman@cendio.se>2007-03-06 15:47:11 +0000
commitf6023cb5ee2c6562c7a47d96828a80a64e3ea59c (patch)
treeb753c0fc1f778fe58f1b58b56a7ed2c237f339b4 /src/pulsecore/cli-command.c
parente042a90a53b7c7b387e3acd06a23638f4826c30f (diff)
Fix some instances where we printed a string without first checking that
the pointer was valid. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1436 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulsecore/cli-command.c')
-rw-r--r--src/pulsecore/cli-command.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c
index aa2beba2..e87b257b 100644
--- a/src/pulsecore/cli-command.c
+++ b/src/pulsecore/cli-command.c
@@ -246,6 +246,7 @@ static int pa_cli_command_stat(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, PA_G
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] = {
[PA_MEMBLOCK_POOL] = "POOL",
@@ -283,10 +284,12 @@ static int pa_cli_command_stat(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, PA_G
pa_strbuf_printf(buf, "Default sample spec: %s\n",
pa_sample_spec_snprint(s, sizeof(s), &c->default_sample_spec));
+ def_sink = pa_namereg_get_default_sink_name(c);
+ def_source = 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 = 0; k < PA_MEMBLOCK_TYPE_MAX; k++)
pa_strbuf_printf(buf,