summaryrefslogtreecommitdiff
path: root/tests/gd2
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-07-22 08:14:12 +0200
committerRemi Collet <fedora@famillecollet.com>2016-07-22 08:14:12 +0200
commit2b3dd57a6ccb2940f2e9119ae04e14362e2a1f61 (patch)
tree591b06942a4d784bf809d81d5a725f2877ea07f4 /tests/gd2
parent1586f16bc29b34454da15023ac637543e1c6a145 (diff)
downloadlibgd-2b3dd57a6ccb2940f2e9119ae04e14362e2a1f61.tar.gz
Fix gd2/gd2_read.c:8:6: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized]
Also report about any error, not only the last one.
Diffstat (limited to 'tests/gd2')
-rw-r--r--tests/gd2/gd2_read.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/tests/gd2/gd2_read.c b/tests/gd2/gd2_read.c
index 94fe069..8ce8bd1 100644
--- a/tests/gd2/gd2_read.c
+++ b/tests/gd2/gd2_read.c
@@ -5,7 +5,7 @@
int main(int argc, char *argv[])
{
- int error, i = 0;
+ int error = 0, i = 0;
gdImagePtr im, exp;
FILE *fp;
char *path[] = {
@@ -40,8 +40,6 @@ int main(int argc, char *argv[])
gdTestErrorMsg("image %s differs from expected result\n", path[i]);
gdImageDestroy(im);
error = 1;
- } else {
- error = 0;
}
if (exp) {
gdImageDestroy(exp);
@@ -52,8 +50,6 @@ int main(int argc, char *argv[])
gdTestErrorMsg("image %s should have failed to be loaded\n", path[i]);
gdImageDestroy(im);
error = 1;
- } else {
- error = 0;
}
}
i++;