[Mplayer-cvslog] CVS: main/TOOLS vivodump.c,1.9,1.10
Alexander Strasser beastd
syncmail at mplayerhq.hu
Sat Oct 30 00:05:36 CEST 2004
CVS change done by Alexander Strasser (beastd)
Update of /cvsroot/mplayer/main/TOOLS
In directory mail:/var2/tmp/cvs-serv19804/TOOLS
Modified Files:
vivodump.c
Log Message:
Fixed the assumption user will always give 2+ args to the program.
Index: vivodump.c
===================================================================
RCS file: /cvsroot/mplayer/main/TOOLS/vivodump.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- vivodump.c 28 Oct 2004 01:02:24 -0000 1.9
+++ vivodump.c 29 Oct 2004 22:05:34 -0000 1.10
@@ -151,7 +151,7 @@
int postable[32768];
-int main(int argv,char ** argc){
+int main(int argc,char ** argv){
int c;
unsigned int head=-1;
int pos=0;
@@ -167,13 +167,20 @@
int flag2=0;
int prefix=0;
+// check if enough args were given
+if ( argc < 3 ){
+ printf("Too few arguments given!\n"
+ "Usage: %s <input_file> <output_file>\n", argv[0]);
+
+ return -1;
+}
// input
-if(!(f=fopen(argc[1],"rb"))){
+if(!(f=fopen(argv[1],"rb"))){
printf("Couldn't open input file.\n");
return -1;
}
// output
-if(!(f2=fopen(argc[2],"wb"))){
+if(!(f2=fopen(argv[2],"wb"))){
printf("Couldn't open output file.\n");
return -1;
}
More information about the MPlayer-cvslog
mailing list