summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authoral <al@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-29 22:05:34 +0000
committeral <al@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-29 22:05:34 +0000
commita8db0e4a909df5857753fb0e6280e5c70fa4c5c5 (patch)
tree572d6a511014fab4fd1446e1444d99072f586ec5 /TOOLS
parent4aa0c761245e72e843813ed483a983435abdeabc (diff)
downloadmpv-a8db0e4a909df5857753fb0e6280e5c70fa4c5c5.tar.bz2
mpv-a8db0e4a909df5857753fb0e6280e5c70fa4c5c5.tar.xz
Fixed the assumption user will always give 2+ args to the program.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13802 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'TOOLS')
-rw-r--r--TOOLS/vivodump.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/TOOLS/vivodump.c b/TOOLS/vivodump.c
index 9896dacb21..a35b4ddd58 100644
--- a/TOOLS/vivodump.c
+++ b/TOOLS/vivodump.c
@@ -151,7 +151,7 @@ int h263_decode_picture_header(unsigned char *b_ptr)
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 flag=0;
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;
}