Mercurial > hg > dmlib
diff tools/view64.c @ 1404:89725addaeaf
Improve error checking.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 30 Oct 2017 20:33:28 +0200 |
parents | 009534f27de5 |
children | c29f1cea4a1c |
line wrap: on
line diff
--- a/tools/view64.c Mon Oct 30 18:15:11 2017 +0200 +++ b/tools/view64.c Mon Oct 30 20:33:28 2017 +0200 @@ -246,7 +246,7 @@ ret = dmC64DecodeBMP(&cimage, dataBuf, dataSize, 0, 2, &fmt, forced); - if (ret < 0) + if (ret != DMERR_OK) { dmErrorMsg("Failed to decode bitmap data %d: %s\n", ret, dmErrorStr(ret)); goto error; @@ -298,6 +298,11 @@ else ret = dmC64ConvertGenericBMP2Image(&bmap, cimage, fmt); + if (ret != DMERR_OK) + { + dmErrorMsg("Failed to convert bitmap data %d: %s\n", ret, dmErrorStr(ret)); + goto error; + } // Set window title and caption windowTitle = dm_strdup_printf("%s - %s (%d x %d)",