aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/panning.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-09-19 11:29:18 -0700
committerChris Robinson <[email protected]>2011-09-19 11:29:18 -0700
commitedb386eb1edaed1661089064bab57c8d39c52a15 (patch)
treeb0551187a3003a117e591ff87d459ee95eb3be4c /Alc/panning.c
parentcc3dd648ace1f1276e909dcb07adf782a39f1cf3 (diff)
Add a ConfigValueStr function, to return the string through a parameter
Diffstat (limited to 'Alc/panning.c')
-rw-r--r--Alc/panning.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/Alc/panning.c b/Alc/panning.c
index b225e3ec..983d3ef6 100644
--- a/Alc/panning.c
+++ b/Alc/panning.c
@@ -34,21 +34,17 @@
static void SetSpeakerArrangement(const char *name, ALfloat SpeakerAngle[MAXCHANNELS],
enum Channel Speaker2Chan[MAXCHANNELS], ALint chans)
{
- char layout_str[256];
char *confkey, *next;
+ char *layout_str;
char *sep, *end;
enum Channel val;
+ const char *str;
int i;
- if(!ConfigValueExists(NULL, name))
- name = "layout";
-
- strncpy(layout_str, GetConfigValue(NULL, name, ""), sizeof(layout_str));
- layout_str[sizeof(layout_str)-1] = 0;
-
- if(!layout_str[0])
+ if(!ConfigValueStr(NULL, name, &str) && !ConfigValueStr(NULL, "layout", &str))
return;
+ layout_str = strdup(str);
next = confkey = layout_str;
while(next && *next)
{
@@ -113,6 +109,8 @@ static void SetSpeakerArrangement(const char *name, ALfloat SpeakerAngle[MAXCHAN
}
}
}
+ free(layout_str);
+ layout_str = NULL;
for(i = 0;i < chans;i++)
{