From 643f5ea1e0402d05e71d4f0340ea8f29042b8c79 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 15 Jul 2010 18:45:20 -0700 Subject: glsl/apps: Handle ftell errors in non-debug builds. --- src/glsl/apps/compile.c | 3 +++ src/glsl/apps/process.c | 3 +++ src/glsl/apps/purify.c | 3 +++ src/glsl/apps/tokenise.c | 3 +++ src/glsl/apps/version.c | 3 +++ 5 files changed, 15 insertions(+) (limited to 'src/glsl') diff --git a/src/glsl/apps/compile.c b/src/glsl/apps/compile.c index 5073b0da82..3aa4fd4d53 100644 --- a/src/glsl/apps/compile.c +++ b/src/glsl/apps/compile.c @@ -82,6 +82,9 @@ main(int argc, fseek(in, 0, SEEK_END); size = ftell(in); assert(size != -1); + if (size == -1) { + return 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 c8a1a1868c..caf72a71cf 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -59,6 +59,9 @@ main(int argc, fseek(in, 0, SEEK_END); size = ftell(in); assert(size != -1); + if (size == -1) { + return 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 5ab6bae96d..0f09b157ef 100644 --- a/src/glsl/apps/purify.c +++ b/src/glsl/apps/purify.c @@ -58,6 +58,9 @@ main(int argc, fseek(in, 0, SEEK_END); size = ftell(in); assert(size != -1); + if (size == -1) { + return 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 b4c6d60930..f89f47d061 100644 --- a/src/glsl/apps/tokenise.c +++ b/src/glsl/apps/tokenise.c @@ -58,6 +58,9 @@ main(int argc, fseek(in, 0, SEEK_END); size = ftell(in); assert(size != -1); + if (size == -1) { + return 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 9820ad94dc..fa5c226da8 100644 --- a/src/glsl/apps/version.c +++ b/src/glsl/apps/version.c @@ -57,6 +57,9 @@ main(int argc, fseek(in, 0, SEEK_END); size = ftell(in); assert(size != -1); + if (size == -1) { + return 1; + } fseek(in, 0, SEEK_SET); out = fopen(argv[2], "wb"); -- cgit v1.2.3