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

Diff of /lbbs/src/menu.c

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

Revision 1.31 by sysadm, Thu May 8 08:05:58 2025 UTC Revision 1.33 by sysadm, Thu May 8 15:24:59 2025 UTC
# Line 42  int load_menu(MENU_SET *p_menu_set, cons Line 42  int load_menu(MENU_SET *p_menu_set, cons
42          int i = 0;          int i = 0;
43          int j = 0;          int j = 0;
44          char buffer[LINE_BUFFER_LEN];          char buffer[LINE_BUFFER_LEN];
45            char temp[LINE_BUFFER_LEN];
46          char screen_filename[FILE_PATH_LEN];          char screen_filename[FILE_PATH_LEN];
47          char *p = NULL;          char *p = NULL;
48          char *q = NULL;          char *q = NULL;
# Line 83  int load_menu(MENU_SET *p_menu_set, cons Line 84  int load_menu(MENU_SET *p_menu_set, cons
84                          {                          {
85                                  if (p_menu != NULL)                                  if (p_menu != NULL)
86                                  {                                  {
87                                          log_error("Begin new menu without end the prior one, in menu config line %d\n", fin_line);                                          log_error("Incomplete menu definition in menu config line %d\n", fin_line);
88                                          return -1;                                          return -1;
89                                  }                                  }
90                                  p_menu = (MENU *)malloc(sizeof(MENU));                                  p_menu = (MENU *)malloc(sizeof(MENU));
# Line 306  int load_menu(MENU_SET *p_menu_set, cons Line 307  int load_menu(MENU_SET *p_menu_set, cons
307                                                  q = strtok_r(NULL, MENU_CONF_DELIM_WITHOUT_SPACE, &saveptr);                                                  q = strtok_r(NULL, MENU_CONF_DELIM_WITHOUT_SPACE, &saveptr);
308                                                  if (q == NULL || (q = strchr(q, '\"')) == NULL)                                                  if (q == NULL || (q = strchr(q, '\"')) == NULL)
309                                                  {                                                  {
310                                                          log_error("Error #1 menu item text in menu config line %d\n", fin_line);                                                          log_error("Error menu item text in menu config line %d\n", fin_line);
311                                                          return -1;                                                          return -1;
312                                                  }                                                  }
313                                                  q++;                                                  q++;
# Line 521  int load_menu(MENU_SET *p_menu_set, cons Line 522  int load_menu(MENU_SET *p_menu_set, cons
522                                  {                                  {
523                                          fin_line++;                                          fin_line++;
524    
525                                          p = strtok_r(buffer, MENU_CONF_DELIM_WITH_SPACE, &saveptr);                                          memcpy(temp, buffer, sizeof(temp)); // Duplicate line for strtok_r
526                                            p = strtok_r(temp, MENU_CONF_DELIM_WITH_SPACE, &saveptr);
527                                          if (p != NULL && *p == '%') // END of menu screen                                          if (p != NULL && *p == '%') // END of menu screen
528                                          {                                          {
529                                                  break;                                                  break;


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

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