summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2011-09-21 18:46:56 +0200
committerDiego Biurrun <diego@biurrun.de>2011-12-08 01:00:58 +0100
commit9a5d6c23c5cc25b887f996d55f96dfbacf760e88 (patch)
tree78a4bad898880ef2a740306908204a008980a581 /tools
parentbe0675ce672b7788b0f1277704be663f415d6498 (diff)
downloadffmpeg-9a5d6c23c5cc25b887f996d55f96dfbacf760e88.tar.gz
tests/tools/examples: Replace direct exit() calls by return.
Diffstat (limited to 'tools')
-rw-r--r--tools/cws2fws.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/cws2fws.c b/tools/cws2fws.c
index b8535feaa4..35fce35683 100644
--- a/tools/cws2fws.c
+++ b/tools/cws2fws.c
@@ -29,14 +29,14 @@ int main(int argc, char *argv[])
if (argc < 3)
{
printf("Usage: %s <infile.swf> <outfile.swf>\n", argv[0]);
- exit(1);
+ return 1;
}
fd_in = open(argv[1], O_RDONLY);
if (fd_in < 0)
{
perror("Error opening input file");
- exit(1);
+ return 1;
}
fd_out = open(argv[2], O_WRONLY|O_CREAT, 00644);
@@ -44,7 +44,7 @@ int main(int argc, char *argv[])
{
perror("Error opening output file");
close(fd_in);
- exit(1);
+ return 1;
}
if (read(fd_in, &buf_in, 8) != 8)
@@ -52,13 +52,13 @@ int main(int argc, char *argv[])
printf("Header error\n");
close(fd_in);
close(fd_out);
- exit(1);
+ return 1;
}
if (buf_in[0] != 'C' || buf_in[1] != 'W' || buf_in[2] != 'S')
{
printf("Not a compressed flash file\n");
- exit(1);
+ return 1;
}
fstat(fd_in, &statbuf);
@@ -71,7 +71,7 @@ int main(int argc, char *argv[])
buf_in[0] = 'F';
if (write(fd_out, &buf_in, 8) < 8) {
perror("Error writing output file");
- exit(1);
+ return 1;
}
zstream.zalloc = NULL;
@@ -97,7 +97,7 @@ int main(int argc, char *argv[])
{
printf("Error while decompressing: %d\n", ret);
inflateEnd(&zstream);
- exit(1);
+ return 1;
}
dbgprintf("a_in: %d t_in: %lu a_out: %d t_out: %lu -- %lu out\n",
@@ -106,7 +106,7 @@ int main(int argc, char *argv[])
if (write(fd_out, &buf_out, zstream.total_out - last_out) < zstream.total_out - last_out) {
perror("Error writing output file");
- exit(1);
+ return 1;
}
i += len;
@@ -128,7 +128,7 @@ int main(int argc, char *argv[])
lseek(fd_out, 4, SEEK_SET);
if (write(fd_out, &buf_in, 4) < 4) {
perror("Error writing output file");
- exit(1);
+ return 1;
}
}