diff options
Diffstat (limited to 'src/gui_gtk.c')
-rw-r--r-- | src/gui_gtk.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gui_gtk.c b/src/gui_gtk.c index 5bde7913c8..cdd645b659 100644 --- a/src/gui_gtk.c +++ b/src/gui_gtk.c @@ -1476,8 +1476,7 @@ dlg_destroy(GtkWidget *dlg) const char *text; text = gtk_entry_get_text(GTK_ENTRY(dialog_textentry)); - STRNCPY(dialog_textfield, text, IOSIZE); - dialog_textfield[IOSIZE - 1] = NUL; + vim_strncpy(dialog_textfield, (char_u *)text, IOSIZE - 1); } /* Destroy the dialog, will break the waiting loop. */ @@ -2340,8 +2339,7 @@ gui_mch_dialog(int type, /* type of dialog */ text = (char_u *)gtk_entry_get_text(GTK_ENTRY(entry)); text = CONVERT_FROM_UTF8(text); - STRNCPY(textfield, text, IOSIZE); - textfield[IOSIZE - 1] = NUL; + vim_strncpy(textfield, text, IOSIZE - 1); CONVERT_FROM_UTF8_FREE(text); } |