pefile.cpp: make import sorting independent from qsort() internals.
This commit is contained in:
+3
-1
@@ -874,7 +874,9 @@ unsigned PeFile::processImports0(ord_mask_t ord_mask) // pass 1
|
||||
if (u2->ordinal) return 1;
|
||||
if (!u1->shname) return 1;
|
||||
if (!u2->shname) return -1;
|
||||
return strlen(u1->shname) - strlen(u2->shname);
|
||||
rc = (int) (upx_strlen(u1->shname) - upx_strlen(u2->shname));
|
||||
if (rc) return rc;
|
||||
return strcmp(u1->shname, u2->shname);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -100,6 +100,10 @@ inline char *strcpy(unsigned char *s1, const unsigned char *s2) {
|
||||
return strcpy((char *) s1, (const char *) s2);
|
||||
}
|
||||
|
||||
inline int strcmp(const unsigned char *s1, const unsigned char *s2) {
|
||||
return strcmp((const char *) s1, (const char *) s2);
|
||||
}
|
||||
|
||||
inline int strcasecmp(const unsigned char *s1, const unsigned char *s2) {
|
||||
return strcasecmp((const char *) s1, (const char *) s2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user