log: Fix incorect range check in log_get_cat_name()