pefile.cpp: make import sorting independent from qsort() internals.

This commit is contained in:
Markus F.X.J. Oberhumer
2016-10-09 00:28:22 +02:00
parent 38a265741c
commit 4b991203df
2 changed files with 7 additions and 1 deletions
+3 -1
View File
@@ -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);
}
};
+4
View File
@@ -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);
}