1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-05 09:48:42 +00:00

Use string_is_equal

This commit is contained in:
twinaphex 2016-10-04 10:24:17 +02:00
parent 7d06e6c48f
commit 49a290c3e6
3 changed files with 7 additions and 6 deletions

View File

@ -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))
{

View File

@ -34,6 +34,7 @@
#include <streams/file_stream.h>
#include <retro_endianness.h>
#include <string/stdstring.h>
#include <compat/strl.h>
#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);

View File

@ -32,6 +32,7 @@
#include <compat/fnmatch.h>
#include <compat/strl.h>
#include <string/stdstring.h>
#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;