1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
--- musicout.c.orig Wed Jan 5 05:39:27 1994
+++ musicout.c Fri Dec 15 02:04:31 2006
@@ -58,6 +58,8 @@
#include "common.h"
#include "decoder.h"
+#include <stdlib.h>
+
/********************************************************************
/*
/* This part contains the MPEG I decoder for Layers I & II.
@@ -139,7 +141,7 @@
if(argc==1) { /* no command line args -> interact */
do {
printf ("Enter encoded file name <required>: ");
- gets (encoded_file_name);
+ fgets (encoded_file_name,sizeof(encoded_file_name),stdin);
if (encoded_file_name[0] == NULL_CHAR)
printf ("Encoded file name is required. \n");
} while (encoded_file_name[0] == NULL_CHAR);
@@ -151,7 +153,7 @@
printf ("Enter MPEG decoded file name <%s%s>: ", encoded_file_name,
DFLT_OPEXT);
#endif
- gets (decoded_file_name);
+ fgets (decoded_file_name,sizeof(decoded_file_name),stdin);
if (decoded_file_name[0] == NULL_CHAR) {
#ifdef MS_DOS
/* replace old extension with new one, 92-08-19 shn */
@@ -164,7 +166,7 @@
printf(
"Do you wish to write an AIFF compatible sound file ? (y/<n>) : ");
- gets(t);
+ fgets(t,sizeof(t),stdin);
if (*t == 'y' || *t == 'Y') need_aiff = TRUE;
else need_aiff = FALSE;
if (need_aiff)
@@ -173,7 +175,7 @@
printf(
"Do you wish to exit (last chance before decoding) ? (y/<n>) : ");
- gets(t);
+ fgets(t,sizeof(t),stdin);
if (*t == 'y' || *t == 'Y') exit(0);
}
else { /* interpret CL Args */
@@ -429,7 +431,7 @@
exit( 0 );
}
-static void usage() /* print syntax & exit */
+void usage() /* print syntax & exit */
{
fprintf(stderr,
"usage: %s queries for all arguments, or\n",
|