зеркало из https://github.com/github/putty.git
On some systems, strncpy is a macro, and putting preprocessor
directives in the middle of a macro invocation appears to be frowned on. Irritating, but there we go. [originally from svn r8026]
This commit is contained in:
Родитель
85c227326c
Коммит
79f7249185
|
@ -367,14 +367,16 @@ void dlg_editbox_get(union control *ctrl, void *dlg, char *buffer, int length)
|
||||||
#if GTK_CHECK_VERSION(2,0,0)
|
#if GTK_CHECK_VERSION(2,0,0)
|
||||||
} else {
|
} else {
|
||||||
assert(uc->combo != NULL);
|
assert(uc->combo != NULL);
|
||||||
strncpy(buffer,
|
|
||||||
#if GTK_CHECK_VERSION(2,6,0)
|
#if GTK_CHECK_VERSION(2,6,0)
|
||||||
|
strncpy(buffer,
|
||||||
gtk_combo_box_get_active_text(GTK_COMBO_BOX(uc->combo)),
|
gtk_combo_box_get_active_text(GTK_COMBO_BOX(uc->combo)),
|
||||||
|
length);
|
||||||
#else
|
#else
|
||||||
|
strncpy(buffer,
|
||||||
gtk_entry_get_text
|
gtk_entry_get_text
|
||||||
(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(uc->combo)))),
|
(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(uc->combo)))),
|
||||||
#endif
|
|
||||||
length);
|
length);
|
||||||
|
#endif
|
||||||
buffer[length-1] = '\0';
|
buffer[length-1] = '\0';
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Загрузка…
Ссылка в новой задаче