mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Error checking: make sure that there are 3 parameters and that the
file open operation succeeds. Originally committed as revision 11479 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
f34b221bd2
commit
90527811d7
@ -6,10 +6,21 @@
|
|||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FILE *f= fopen(argv[1], "rb+");
|
FILE *f;
|
||||||
int count= atoi(argv[2]);
|
int count, maxburst, length;
|
||||||
int maxburst= atoi(argv[3]);
|
|
||||||
int length;
|
if (argc < 4){
|
||||||
|
printf("USAGE: trasher <filename> <count> <maxburst>\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
f= fopen(argv[1], "rb+");
|
||||||
|
if (!f){
|
||||||
|
perror(argv[1]);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
count= atoi(argv[2]);
|
||||||
|
maxburst= atoi(argv[3]);
|
||||||
|
|
||||||
srand (time (0));
|
srand (time (0));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user