[Liboss-commit] CVS: liboss/lib esddsp.c,1.11,1.12
Brought to you by:
thesin
|
From: Max H. <fin...@us...> - 2002-11-06 23:34:48
|
Update of /cvsroot/liboss/liboss/lib
In directory usw-pr-cvs1:/tmp/cvs-serv11645
Modified Files:
esddsp.c
Log Message:
use the same indention rule everywhere; added two FIXME's, for the people working on this to review :-)
Index: esddsp.c
===================================================================
RCS file: /cvsroot/liboss/liboss/lib/esddsp.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- esddsp.c 6 Nov 2002 20:44:45 -0000 1.11
+++ esddsp.c 6 Nov 2002 23:34:45 -0000 1.12
@@ -94,18 +94,32 @@
{
if (!ident)
{
+ /* FIXME - the value of getenv is AFAIK guranteed to stay current during the
+ whole program run time. So in theory the next three lines could be replaced
+ by something like this:
+
+ char *str = getenv ("ESDDSP_NAME");
+ if (!str)
+ str = "esddsp";
+
+ If anybody can test it...
+ */
+
char *str = getenv ("ESDDSP_NAME");
ident = malloc (ESD_NAME_MAX);
strncpy (ident, (str ? str : "esddsp"), ESD_NAME_MAX);
- use_mixer = 1;
-
- str = getenv ("HOME");
- if (str)
- {
- mixer = malloc (strlen (str) + strlen (ident) + 10);
- sprintf (mixer, "%s/.esddsp_%s", str, ident);
- }
+ use_mixer = 1;
+
+ str = getenv ("HOME");
+ /* FIXME - if $HOME is not set, mixer will stay NULL, but is passed later
+ on to open, leading to a potential crash.
+ */
+ if (str)
+ {
+ mixer = malloc (strlen (str) + strlen (ident) + 10);
+ sprintf (mixer, "%s/.esddsp_%s", str, ident);
+ }
}
}
@@ -139,10 +153,10 @@
static void liboss_init(void)
{
if (!acquired_handle)
- {
+ {
libSystem_handle = dlopen("/usr/lib/libSystem.dylib",RTLD_LAZY);
acquired_handle = 1;
- }
+ }
dsp_init();
}
|