mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-05 05:18:40 +00:00
resource id compar typo
This commit is contained in:
@@ -476,15 +476,15 @@ coff_write_resource(Arena *arena,
|
|||||||
internal int
|
internal int
|
||||||
coff_resource_id_compar(void *raw_a, void *raw_b)
|
coff_resource_id_compar(void *raw_a, void *raw_b)
|
||||||
{
|
{
|
||||||
int cmp = 0;
|
int cmp;
|
||||||
COFF_ResourceID *a = raw_a;
|
COFF_ResourceID *a = raw_a;
|
||||||
COFF_ResourceID *b = raw_b;
|
COFF_ResourceID *b = raw_b;
|
||||||
if (a->type == b->type) {
|
if (a->type == b->type) {
|
||||||
switch (a->type) {
|
switch (a->type) {
|
||||||
|
default:
|
||||||
case COFF_ResourceIDType_Null: cmp = 0; break;
|
case COFF_ResourceIDType_Null: cmp = 0; break;
|
||||||
case COFF_ResourceIDType_Number: cmp = MemoryCompare(&a->u.number, &b->u.number, sizeof(a->u.number)); break;
|
case COFF_ResourceIDType_Number: cmp = MemoryCompare(&a->u.number, &b->u.number, sizeof(a->u.number)); break;
|
||||||
case COFF_ResourceIDType_String: cmp = strncmp((char *)a->u.string.str, (char *)b->u.string.str, Min(a->u.string.size, b->u.string.size)); break;
|
case COFF_ResourceIDType_String: cmp = strncmp((char *)a->u.string.str, (char *)b->u.string.str, Min(a->u.string.size, b->u.string.size)); break;
|
||||||
default: InvalidPath; break;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cmp = a->type < b->type ? -1 : a->type > b->type ? +1 : 0;
|
cmp = a->type < b->type ? -1 : a->type > b->type ? +1 : 0;
|
||||||
|
|||||||
+1
-1
@@ -1568,7 +1568,7 @@ pe_resource_dir_push_dir(Arena *arena, PE_ResourceDir *dir, COFF_ResourceID id,
|
|||||||
internal PE_ResourceNode *
|
internal PE_ResourceNode *
|
||||||
pe_resource_dir_search_node(PE_ResourceDir *dir, COFF_ResourceID id)
|
pe_resource_dir_search_node(PE_ResourceDir *dir, COFF_ResourceID id)
|
||||||
{
|
{
|
||||||
for (PE_ResourceNode *i = dir->id_list.first; i != NULL; i = i->next) {
|
for (PE_ResourceNode *i = dir->id_list.first; i != 0; i = i->next) {
|
||||||
if (coff_resource_id_compar(&i->data.id, &id) == 0) {
|
if (coff_resource_id_compar(&i->data.id, &id) == 0) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user