OSDN Git Service

glsl/apps: Handle ftell errors in non-debug builds.
authorVinson Lee <vlee@vmware.com>
Fri, 16 Jul 2010 01:45:20 +0000 (18:45 -0700)
committerVinson Lee <vlee@vmware.com>
Fri, 16 Jul 2010 01:45:20 +0000 (18:45 -0700)
src/glsl/apps/compile.c
src/glsl/apps/process.c
src/glsl/apps/purify.c
src/glsl/apps/tokenise.c
src/glsl/apps/version.c

index 5073b0d..3aa4fd4 100644 (file)
@@ -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");
index c8a1a18..caf72a7 100644 (file)
@@ -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");
index 5ab6bae..0f09b15 100644 (file)
@@ -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");
index b4c6d60..f89f47d 100644 (file)
@@ -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");
index 9820ad9..fa5c226 100644 (file)
@@ -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");