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

Diff of /lbbs/src/screen.c

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

Revision 1.89 by sysadm, Sun Jun 8 09:25:25 2025 UTC Revision 1.90 by sysadm, Mon Jun 9 15:39:30 2025 UTC
# Line 426  int display_data(const void *p_data, lon Line 426  int display_data(const void *p_data, lon
426                                          break;                                          break;
427                                  case KEY_F2: // For test only                                  case KEY_F2: // For test only
428                                          EDITOR_DATA *p_editor_data;                                          EDITOR_DATA *p_editor_data;
429                                          size_t data_new_len = strlen(p_data) + 1;                                          // size_t data_new_len = strlen(p_data) + LINE_BUFFER_LEN;
430    
431                                          char *p_data_new = malloc(data_new_len);                                          // char *p_data_new = malloc(data_new_len);
432                                          if (p_data_new == NULL)                                          // if (p_data_new == NULL)
433                                          {                                          // {
434                                                  break;                                          //      break;
435                                          }                                          // }
436                                          p_editor_data = editor_data_load(p_data);                                          p_editor_data = editor_data_load(p_data);
437                                          if (p_editor_data == NULL)                                          if (p_editor_data == NULL)
438                                          {                                          {
439                                                  free(p_data_new);                                                  // free(p_data_new);
440                                                  break;                                                  break;
441                                          }                                          }
442    
443                                          editor_display(p_editor_data);                                          editor_display(p_editor_data);
444                                          editor_data_save(p_editor_data, p_data_new, data_new_len);                                          // editor_data_save(p_editor_data, p_data_new, data_new_len);
   
                                         if (strcmp(p_data, p_data_new) != 0)  
                                         {  
                                                 log_error("Data was changed\n");  
                                         }  
   
445                                          editor_data_cleanup(p_editor_data);                                          editor_data_cleanup(p_editor_data);
446                                          p_editor_data = NULL;                                          p_editor_data = NULL;
447                                          free(p_data_new);                                          // free(p_data_new);
448                                          p_data_new = NULL;                                          // p_data_new = NULL;
449    
450                                          // Refresh after display editor                                          // Refresh after display editor
451                                          line_current -= (screen_current_line - screen_begin_line);                                          line_current -= (screen_current_line - screen_begin_line);


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

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