Mercurial > hg > dmlib
changeset 1404:89725addaeaf
Improve error checking.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 30 Oct 2017 20:33:28 +0200 |
parents | 6aa0897265e8 |
children | ffa540ec354d |
files | tools/view64.c |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
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)",