mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-11 23:16:05 +00:00
Check version for pkgname correctly (#15860)
dot can be null Using R2_VERSION_MAJOR/MINOR is wrong because they will be continuously updated and we want to check for exactly 4.2.0 The version check logic itself was wrong
This commit is contained in:
parent
52820e2f58
commit
c01a491bd2
@ -306,8 +306,9 @@ R_API int r_lib_open_ptr(RLib *lib, const char *file, void *handler, RLibStruct
|
||||
if (stru->pkgname) {
|
||||
const char *dot = strchr (stru->version, '.');
|
||||
int major = atoi (stru->version);
|
||||
int minor = atoi (dot + 1);
|
||||
if (major >= R2_VERSION_MAJOR && minor >= R2_VERSION_MINOR) {
|
||||
int minor = dot ? atoi (dot + 1) : 0;
|
||||
// The pkgname member was introduced in 4.2.0
|
||||
if (major >= 4 || (major == 4 && minor >= 2)) {
|
||||
printf ("r2pm -ci %s\n", stru->pkgname);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user