annotate get_path.c @ 9130:8a0a93d6b4c3

In mp3lib/sr1.c, look at the line 226: if(fr->sampling_frequency>8) return FALSE; // valid: 0..8 which allows fr->sampling_frequency to go up to 8. Obviously, the code does not bother about what would happen if fr->sampling_frequency lies in the range [3,8]. patch from Nilmoni Deb, Nick?, Rich
author arpi
date Tue, 28 Jan 2003 00:25:38 +0000
parents d21bae2028a6
children ad429d617df4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2557
6a74454ea121 some cleanup
arpi
parents:
diff changeset
1
6a74454ea121 some cleanup
arpi
parents:
diff changeset
2 char *get_path(char *filename){
6a74454ea121 some cleanup
arpi
parents:
diff changeset
3 char *homedir;
6a74454ea121 some cleanup
arpi
parents:
diff changeset
4 char *buff;
6a74454ea121 some cleanup
arpi
parents:
diff changeset
5 static char *config_dir = "/.mplayer";
6a74454ea121 some cleanup
arpi
parents:
diff changeset
6 int len;
6a74454ea121 some cleanup
arpi
parents:
diff changeset
7
6a74454ea121 some cleanup
arpi
parents:
diff changeset
8 if ((homedir = getenv("HOME")) == NULL)
6a74454ea121 some cleanup
arpi
parents:
diff changeset
9 return NULL;
6a74454ea121 some cleanup
arpi
parents:
diff changeset
10 len = strlen(homedir) + strlen(config_dir) + 1;
6a74454ea121 some cleanup
arpi
parents:
diff changeset
11 if (filename == NULL) {
6a74454ea121 some cleanup
arpi
parents:
diff changeset
12 if ((buff = (char *) malloc(len)) == NULL)
6a74454ea121 some cleanup
arpi
parents:
diff changeset
13 return NULL;
6a74454ea121 some cleanup
arpi
parents:
diff changeset
14 sprintf(buff, "%s%s", homedir, config_dir);
6a74454ea121 some cleanup
arpi
parents:
diff changeset
15 } else {
6a74454ea121 some cleanup
arpi
parents:
diff changeset
16 len += strlen(filename) + 1;
6a74454ea121 some cleanup
arpi
parents:
diff changeset
17 if ((buff = (char *) malloc(len)) == NULL)
6a74454ea121 some cleanup
arpi
parents:
diff changeset
18 return NULL;
6a74454ea121 some cleanup
arpi
parents:
diff changeset
19 sprintf(buff, "%s%s/%s", homedir, config_dir, filename);
6a74454ea121 some cleanup
arpi
parents:
diff changeset
20 }
3746
d21bae2028a6 some debugging
arpi
parents: 2557
diff changeset
21 mp_msg(MSGT_GLOBAL,MSGL_V,"get_path('%s') -> '%s'\n",filename,buff);
2557
6a74454ea121 some cleanup
arpi
parents:
diff changeset
22 return buff;
6a74454ea121 some cleanup
arpi
parents:
diff changeset
23 }