Fix error in gcc 12.2.0 38/294038/1 accepted/tizen_unified_dev accepted/tizen/unified/20230713.014411 accepted/tizen/unified/dev/20230726.115855
authorJinWang An <jinwang.an@samsung.com>
Mon, 12 Jun 2023 03:44:03 +0000 (12:44 +0900)
committerJinWang An <jinwang.an@samsung.com>
Mon, 12 Jun 2023 03:44:03 +0000 (12:44 +0900)
comparison will always evaluate as 'false' for the pointer operand in 'filename + 1' must not be NULL [-Werror=address]
comparison will always evaluate as 'false' for the pointer operand in 'ext + 1' must not be NULL [-Werror=address]

Change-Id: Iec104822595a57f1dbfe9b875c8804696837b360
Signed-off-by: JinWang An <jinwang.an@samsung.com>
src/sst_utils_wrapper.c

index 5b0c822..1098523 100644 (file)
@@ -111,10 +111,10 @@ bool sstu_is_valid_image(const char *path)
                                                        "bmp", "dib", "gif", "png", "webp",
                                                        };
        char *filename = strrchr(path, '/');
-       if (NULL == filename || NULL == filename + 1)
+       if (NULL == filename || '\0' == filename[1])
                return false;
        char *ext = strrchr(filename + 1, '.');
-       if (NULL == ext || NULL == ext + 1)
+       if (NULL == ext || '\0' == ext[1])
                return false;
        for (int i =  0; i < 10; i++) {
                if (!strcmp(ext + 1, ext_list[i]))