/[LeafOK_CVS]/lbbs/src/section_list.c
ViewVC logotype

Diff of /lbbs/src/section_list.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.23 by sysadm, Mon May 26 03:20:39 2025 UTC Revision 1.24 by sysadm, Mon May 26 04:47:45 2025 UTC
# Line 577  void section_list_cleanup(void) Line 577  void section_list_cleanup(void)
577  SECTION_LIST *section_list_find_by_name(const char *sname)  SECTION_LIST *section_list_find_by_name(const char *sname)
578  {  {
579          int64_t index;          int64_t index;
580            int ret;
581    
582          if (p_section_list_pool == NULL)          if (p_section_list_pool == NULL)
583          {          {
# Line 584  SECTION_LIST *section_list_find_by_name( Line 585  SECTION_LIST *section_list_find_by_name(
585                  return NULL;                  return NULL;
586          }          }
587    
588          if (trie_dict_get(p_section_list_pool->p_trie_dict_section_by_name, sname, &index) != 1)          ret = trie_dict_get(p_section_list_pool->p_trie_dict_section_by_name, sname, &index);
589            if (ret < 0)
590          {          {
591                  log_error("trie_dict_get(section, %s) error\n", sname);                  log_error("trie_dict_get(section, %s) error\n", sname);
592                  return NULL;                  return NULL;
593          }          }
594            else if (ret == 0)
595            {
596                    return NULL;
597            }
598    
599          return (p_section_list_pool->sections + index);          return (p_section_list_pool->sections + index);
600  }  }
# Line 596  SECTION_LIST *section_list_find_by_name( Line 602  SECTION_LIST *section_list_find_by_name(
602  SECTION_LIST *section_list_find_by_sid(int32_t sid)  SECTION_LIST *section_list_find_by_sid(int32_t sid)
603  {  {
604          int64_t index;          int64_t index;
605            int ret;
606          char sid_str[SID_STR_LEN];          char sid_str[SID_STR_LEN];
607    
608          if (p_section_list_pool == NULL)          if (p_section_list_pool == NULL)
# Line 606  SECTION_LIST *section_list_find_by_sid(i Line 613  SECTION_LIST *section_list_find_by_sid(i
613    
614          sid_to_str(sid, sid_str);          sid_to_str(sid, sid_str);
615    
616          if (trie_dict_get(p_section_list_pool->p_trie_dict_section_by_sid, sid_str, &index) != 1)          ret = trie_dict_get(p_section_list_pool->p_trie_dict_section_by_sid, sid_str, &index);
617            if (ret < 0)
618          {          {
619                  log_error("trie_dict_get(section, %d) error\n", sid);                  log_error("trie_dict_get(section, %d) error\n", sid);
620                  return NULL;                  return NULL;
621          }          }
622            else if (ret == 0)
623            {
624                    return NULL;
625            }
626    
627          return (p_section_list_pool->sections + index);          return (p_section_list_pool->sections + index);
628  }  }


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1