mirror of
https://github.com/libretro/RetroArch
synced 2025-01-27 21:35:25 +00:00
Use string_is_equal
This commit is contained in:
parent
7d06e6c48f
commit
49a290c3e6
@ -74,7 +74,7 @@ static void find_first_libretro_core(char *first_file,
|
|||||||
salamander_name, sizeof(salamander_name)))
|
salamander_name, sizeof(salamander_name)))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!strncmp(fname, salamander_name, sizeof(fname)))
|
if (string_is_equal(fname, salamander_name))
|
||||||
{
|
{
|
||||||
if (list->size == (i + 1))
|
if (list->size == (i + 1))
|
||||||
{
|
{
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
|
|
||||||
#include <streams/file_stream.h>
|
#include <streams/file_stream.h>
|
||||||
#include <retro_endianness.h>
|
#include <retro_endianness.h>
|
||||||
|
#include <string/stdstring.h>
|
||||||
#include <compat/strl.h>
|
#include <compat/strl.h>
|
||||||
|
|
||||||
#include "libretrodb.h"
|
#include "libretrodb.h"
|
||||||
@ -227,7 +228,7 @@ int libretrodb_open(const char *path, libretrodb_t *db)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strncmp(header.magic_number, MAGIC_NUMBER, sizeof(MAGIC_NUMBER)) != 0)
|
if (!string_is_equal(header.magic_number, MAGIC_NUMBER))
|
||||||
{
|
{
|
||||||
rv = -EINVAL;
|
rv = -EINVAL;
|
||||||
goto error;
|
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);
|
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;
|
return 0;
|
||||||
|
|
||||||
offset = filestream_seek(db->fd, (ssize_t)idx->next, SEEK_CUR);
|
offset = filestream_seek(db->fd, (ssize_t)idx->next, SEEK_CUR);
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
#include <compat/fnmatch.h>
|
#include <compat/fnmatch.h>
|
||||||
#include <compat/strl.h>
|
#include <compat/strl.h>
|
||||||
|
#include <string/stdstring.h>
|
||||||
|
|
||||||
#include "libretrodb.h"
|
#include "libretrodb.h"
|
||||||
#include "query.h"
|
#include "query.h"
|
||||||
@ -468,8 +469,7 @@ static int query_peek(struct buffer buff, const char * data)
|
|||||||
if (remain < strlen(data))
|
if (remain < strlen(data))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return (strncmp(buff.data + buff.offset,
|
return (int)string_is_equal(buff.data + buff.offset, data);
|
||||||
data, strlen(data)) == 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int query_is_eot(struct buffer buff)
|
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)
|
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;
|
invocation->func = rf->func;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user