Crash test fix

pull/80/head
Ivan Yartsev 2 years ago
parent e46cd6402d
commit ce7a1df6ba

@ -300,7 +300,7 @@ void on_inspector_jornald_read_async(inspector_window *window){
if (log)
log++;
if (log){
if (log&&strcmp(log," ")){
char *iden = yon_char_new(identifier);
identifier=yon_char_divide(iden,strlen(identifier)-(strlen(log)-1));
free(iden);
@ -743,6 +743,19 @@ void on_logrotate_period_check_toggled(GtkToggleButton *self,logrotate_configure
}
}
void on_logrotate_paths_cursor_changed(GtkWidget *self, logrotate_configure_window *window){
GtkTreeModel *model = GTK_TREE_MODEL(window->list);
GtkTreeIter iter;
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(window->LogPathsTree)),&model,&iter)){
gtk_widget_set_sensitive(window->LogPathEditButton,1);
gtk_widget_set_sensitive(window->LogPathRemoveButton,1);
} else {
gtk_widget_set_sensitive(window->LogPathEditButton,0);
gtk_widget_set_sensitive(window->LogPathRemoveButton,0);
}
}
void on_logrotate_save(GtkWidget *self, dictionary *dict){
logrotate_window *dialog = yon_dictionary_get_data(dict->first,logrotate_window*);
logrotate_configure_window *window = yon_dictionary_get_data(dict->first->next,logrotate_configure_window*);
@ -1157,6 +1170,8 @@ logrotate_configure_window *yon_logrotate_window_new(char *paths, logrotate_wind
g_signal_connect(G_OBJECT(window->CreateLogButton),"clicked",G_CALLBACK(on_rules_open),window->CreateLogEntry);
g_signal_connect(G_OBJECT(window->LogPathsTree),"cursor-changed",G_CALLBACK(on_logrotate_paths_cursor_changed),window);
int usize=0;
config_str users = yon_ubl_get_all_users(&usize);
yon_gtk_combo_box_fill(window->CreateLogUserCombo,users,usize);

@ -522,6 +522,7 @@ char *yon_cut(char *source, int size, int startpos)
*/
char *yon_char_divide(char *source, int dividepos)
{
if (source){
char *cut = malloc(dividepos + 1);
memset(cut, 0, dividepos + 1);
memcpy(cut, source, dividepos);
@ -531,6 +532,8 @@ char *yon_char_divide(char *source, int dividepos)
memset(source, 0, strlen(source));
memcpy(source, left, strlen(left));
return cut;
}
return NULL;
}
/**yon_char_find_count(char *source, char *find)

Loading…
Cancel
Save