Skip to content

Commit

Permalink
Check anplugs APIs nullability for radareorg#23490
Browse files Browse the repository at this point in the history
  • Loading branch information
astralia committed Oct 28, 2024
1 parent 492ea28 commit e0767dc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libr/anal/anplugs.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ static const SdbGperf *gperfs_types[] = {
};

R_API SdbGperf *r_anal_get_gperf_cc(const char *k) {
R_RETURN_VAL_IF_FAIL (k, NULL);
SdbGperf **gp = (SdbGperf**)gperfs_cc;
char *kk = strdup (k);
r_str_replace_char (kk, '_', '-');
Expand All @@ -92,6 +93,7 @@ R_API SdbGperf *r_anal_get_gperf_cc(const char *k) {
}

R_API SdbGperf *r_anal_get_gperf_types(const char *k) {
R_RETURN_VAL_IF_FAIL (k, NULL);
SdbGperf **gp = (SdbGperf**)gperfs_types;
char *s = strdup (k);
r_str_replace_char (s, '-', '_');
Expand All @@ -107,11 +109,11 @@ R_API SdbGperf *r_anal_get_gperf_types(const char *k) {
return NULL;
}
#else
R_API SdbGperf *r_anal_get_gperf_cc(const char *k) {
R_API SdbGperf *r_anal_get_gperf_cc(R_NULLABLE const char *k) {
return NULL;
}

R_API SdbGperf *r_anal_get_gperf_types(const char *k) {
R_API SdbGperf *r_anal_get_gperf_types(R_NULLABLE const char *k) {
return NULL;
}
#endif
Expand Down

0 comments on commit e0767dc

Please sign in to comment.