/[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.43 by sysadm, Tue Oct 14 05:28:15 2025 UTC Revision 1.44 by sysadm, Tue Oct 14 05:52:29 2025 UTC
# Line 651  SECTION_LIST *section_list_create(int32_ Line 651  SECTION_LIST *section_list_create(int32_
651    
652  int section_list_update(SECTION_LIST *p_section, const char *sname, const char *stitle, const char *master_list)  int section_list_update(SECTION_LIST *p_section, const char *sname, const char *stitle, const char *master_list)
653  {  {
654            int64_t index;
655    
656          if (p_section == NULL || sname == NULL || stitle == NULL || master_list == NULL)          if (p_section == NULL || sname == NULL || stitle == NULL || master_list == NULL)
657          {          {
658                  log_error("NULL pointer error\n");                  log_error("NULL pointer error\n");
659                  return -1;                  return -1;
660          }          }
661    
662            index = get_section_index(p_section);
663    
664          strncpy(p_section->sname, sname, sizeof(p_section->sname) - 1);          strncpy(p_section->sname, sname, sizeof(p_section->sname) - 1);
665          p_section->sname[sizeof(p_section->sname) - 1] = '\0';          p_section->sname[sizeof(p_section->sname) - 1] = '\0';
666    
# Line 666  int section_list_update(SECTION_LIST *p_ Line 670  int section_list_update(SECTION_LIST *p_
670          strncpy(p_section->master_list, master_list, sizeof(p_section->master_list) - 1);          strncpy(p_section->master_list, master_list, sizeof(p_section->master_list) - 1);
671          p_section->master_list[sizeof(p_section->master_list) - 1] = '\0';          p_section->master_list[sizeof(p_section->master_list) - 1] = '\0';
672    
673          if (trie_dict_set(p_section_list_pool->p_trie_dict_section_by_name, sname, p_section_list_pool->section_count) != 1)          if (trie_dict_set(p_section_list_pool->p_trie_dict_section_by_name, sname, index) < 0)
674          {          {
675                  log_error("trie_dict_set(section, %s, %d) error\n", sname, p_section_list_pool->section_count);                  log_error("trie_dict_set(section, %s, %d) error\n", sname, index);
676                  return -2;                  return -2;
677          }          }
678    


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

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