From: Vinson Lee Date: Tue, 23 Feb 2010 07:49:50 +0000 (-0800) Subject: glsl/apps: Assert that ftell does not return an error. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=83a5b7e4689dcc36789f567847ccf65db858a9f3;p=mesa.git glsl/apps: Assert that ftell does not return an error. --- diff --git a/src/glsl/apps/compile.c b/src/glsl/apps/compile.c index 3b3c083c2e1..21c2b7617e9 100644 --- a/src/glsl/apps/compile.c +++ b/src/glsl/apps/compile.c @@ -79,6 +79,7 @@ main(int argc, fseek(in, 0, SEEK_END); size = ftell(in); + assert(size != -1); fseek(in, 0, SEEK_SET); out = fopen(argv[3], "w"); diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index e65f35cc00b..c8a1a1868cc 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -58,6 +58,7 @@ main(int argc, fseek(in, 0, SEEK_END); size = ftell(in); + assert(size != -1); fseek(in, 0, SEEK_SET); out = fopen(argv[2], "wb"); diff --git a/src/glsl/apps/purify.c b/src/glsl/apps/purify.c index 3019e8b2204..5ab6bae96d1 100644 --- a/src/glsl/apps/purify.c +++ b/src/glsl/apps/purify.c @@ -25,6 +25,7 @@ * **************************************************************************/ +#include #include #include #include @@ -56,6 +57,7 @@ main(int argc, fseek(in, 0, SEEK_END); size = ftell(in); + assert(size != -1); fseek(in, 0, SEEK_SET); out = fopen(argv[2], "wb"); diff --git a/src/glsl/apps/tokenise.c b/src/glsl/apps/tokenise.c index c70c3ccbb15..b4c6d609300 100644 --- a/src/glsl/apps/tokenise.c +++ b/src/glsl/apps/tokenise.c @@ -57,6 +57,7 @@ main(int argc, fseek(in, 0, SEEK_END); size = ftell(in); + assert(size != -1); fseek(in, 0, SEEK_SET); out = fopen(argv[2], "wb"); diff --git a/src/glsl/apps/version.c b/src/glsl/apps/version.c index 0420f97294d..9820ad94dc9 100644 --- a/src/glsl/apps/version.c +++ b/src/glsl/apps/version.c @@ -56,6 +56,7 @@ main(int argc, fseek(in, 0, SEEK_END); size = ftell(in); + assert(size != -1); fseek(in, 0, SEEK_SET); out = fopen(argv[2], "wb");