diff options
author | Luca Deri <deri@ntop.org> | 2025-06-06 18:47:57 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2025-06-06 18:48:16 +0200 |
commit | a4459c817b6fca8c3197c2e852b6e33668fbb9ff (patch) | |
tree | f25dbc56df89fe13dfc7ace2a28d77a3cc3e970e /src/lib/ndpi_main.c | |
parent | 38cc4ac22b97f267fe00f2abc6979f5921653b72 (diff) |
Compilation fix on old platforms
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r-- | src/lib/ndpi_main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index f67bf5a65..61e2a257e 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -10986,6 +10986,8 @@ char *ndpi_get_proto_breed_name(ndpi_protocol_breed_t breed_id) { } ndpi_protocol_breed_t ndpi_get_breed_by_name(const char *name) { + int i; + if(!name) return(NDPI_PROTOCOL_UNRATED); @@ -10994,9 +10996,10 @@ ndpi_protocol_breed_t ndpi_get_breed_by_name(const char *name) { /* Cache the lowercased first character of 'name' */ const unsigned char fc = tolower((unsigned char)*name); - - for(int i = NDPI_PROTOCOL_SAFE; i <= NDPI_PROTOCOL_UNRATED; i++) { + + for(i = NDPI_PROTOCOL_SAFE; i <= NDPI_PROTOCOL_UNRATED; i++) { char *breed_name = ndpi_get_proto_breed_name((ndpi_protocol_breed_t)i); + if(breed_name && tolower((unsigned char)*breed_name) == fc) { if(strcasecmp(breed_name + 1, name + 1) == 0) return((ndpi_protocol_breed_t)i); |