diff --git a/frontend/frontend_salamander.c b/frontend/frontend_salamander.c index 280e193271..b8a6582177 100644 --- a/frontend/frontend_salamander.c +++ b/frontend/frontend_salamander.c @@ -74,7 +74,7 @@ static void find_first_libretro_core(char *first_file, salamander_name, sizeof(salamander_name))) break; - if (!strncmp(fname, salamander_name, sizeof(fname))) + if (string_is_equal(fname, salamander_name)) { if (list->size == (i + 1)) { diff --git a/libretro-db/libretrodb.c b/libretro-db/libretrodb.c index 8db5917d13..bc9f265c58 100644 --- a/libretro-db/libretrodb.c +++ b/libretro-db/libretrodb.c @@ -34,6 +34,7 @@ #include #include +#include #include #include "libretrodb.h" @@ -227,7 +228,7 @@ int libretrodb_open(const char *path, libretrodb_t *db) goto error; } - if (strncmp(header.magic_number, MAGIC_NUMBER, sizeof(MAGIC_NUMBER)) != 0) + if (!string_is_equal(header.magic_number, MAGIC_NUMBER)) { rv = -EINVAL; goto error; @@ -264,7 +265,7 @@ static int libretrodb_find_index(libretrodb_t *db, const char *index_name, { libretrodb_read_index_header(db->fd, idx); - if (strncmp(index_name, idx->name, strlen(idx->name)) == 0) + if (string_is_equal(index_name, idx->name)) return 0; offset = filestream_seek(db->fd, (ssize_t)idx->next, SEEK_CUR); diff --git a/libretro-db/query.c b/libretro-db/query.c index 27dccd5ff4..5e11f26d01 100644 --- a/libretro-db/query.c +++ b/libretro-db/query.c @@ -32,6 +32,7 @@ #include #include +#include #include "libretrodb.h" #include "query.h" @@ -468,8 +469,7 @@ static int query_peek(struct buffer buff, const char * data) if (remain < strlen(data)) return 0; - return (strncmp(buff.data + buff.offset, - data, strlen(data)) == 0); + return (int)string_is_equal(buff.data + buff.offset, data); } static int query_is_eot(struct buffer buff) @@ -723,7 +723,7 @@ static struct buffer query_parse_method_call(struct buffer buff, while (rf->name) { - if (strncmp(rf->name, func_name, func_name_len) == 0) + if (string_is_equal(rf->name, func_name)) { invocation->func = rf->func; break;