1
1

* key.c: Use fputs() instead of fprintf().

(func_XOpenDisplay) [HAVE_GMODULE]: Move to init_key_x11().
(get_modifier) [__QNXNTO__]: Use g_snprintf() instead of unsafe sprintf().
Этот коммит содержится в:
Andrew V. Samoilov 2003-03-11 12:23:08 +00:00
родитель 5e267e2ab6
Коммит 0fbccef3cc
2 изменённых файлов: 15 добавлений и 7 удалений

Просмотреть файл

@ -1,3 +1,10 @@
2003-03-11 Andrew V. Samoilov <sav@bcs.zp.ua>
* key.c: Use fputs() instead of fprintf().
(func_XOpenDisplay) [HAVE_GMODULE]: Move to init_key_x11().
(get_modifier) [__QNXNTO__]: Use g_snprintf() instead of unsafe
sprintf().
2003-03-10 Pavel Roskin <proski@gnu.org> 2003-03-10 Pavel Roskin <proski@gnu.org>
* key.c (correct_key_code): Convert unrecognized 0177, Ctrl-h * key.c (correct_key_code): Convert unrecognized 0177, Ctrl-h

Просмотреть файл

@ -192,8 +192,8 @@ void channels_down (void)
void channels_up (void) void channels_up (void)
{ {
if (!disabled_channels) if (!disabled_channels)
fprintf (stderr, fputs ("Error: channels_up called with disabled_channels = 0\n",
"Error: channels_up called with disabled_channels = 0\n"); stderr);
disabled_channels--; disabled_channels--;
} }
@ -267,7 +267,6 @@ define_sequences (key_define_t *kd)
#ifdef HAVE_TEXTMODE_X11_SUPPORT #ifdef HAVE_TEXTMODE_X11_SUPPORT
#ifdef HAVE_GMODULE #ifdef HAVE_GMODULE
static Display *(*func_XOpenDisplay) (_Xconst char *);
static int (*func_XCloseDisplay) (Display *); static int (*func_XCloseDisplay) (Display *);
static Bool (*func_XQueryPointer) (Display *, Window, Window *, Window *, static Bool (*func_XQueryPointer) (Display *, Window, Window *, Window *,
int *, int *, int *, int *, int *, int *, int *, int *,
@ -283,6 +282,7 @@ static void
init_key_x11 (void) init_key_x11 (void)
{ {
#ifdef HAVE_GMODULE #ifdef HAVE_GMODULE
static Display *(*func_XOpenDisplay) (_Xconst char *);
gchar *x11_module_fname; gchar *x11_module_fname;
#endif /* HAVE_GMODULE */ #endif /* HAVE_GMODULE */
@ -716,7 +716,7 @@ int get_key_code (int no_delay)
GET_TIME (esctime); GET_TIME (esctime);
if (this == NULL) { if (this == NULL) {
/* Shouldn't happen */ /* Shouldn't happen */
fprintf (stderr, "Internal error\n"); fputs ("Internal error\n", stderr);
exit (1); exit (1);
} }
goto nodelay_try_again; goto nodelay_try_again;
@ -1072,7 +1072,7 @@ void
numeric_keypad_mode (void) numeric_keypad_mode (void)
{ {
if (console_flag || xterm_flag) { if (console_flag || xterm_flag) {
fprintf (stdout, "\033>"); fputs ("\033>", stdout);
fflush (stdout); fflush (stdout);
} }
} }
@ -1081,7 +1081,7 @@ void
application_keypad_mode (void) application_keypad_mode (void)
{ {
if (console_flag || xterm_flag) { if (console_flag || xterm_flag) {
fprintf (stdout, "\033="); fputs ("\033=", stdout);
fflush (stdout); fflush (stdout);
} }
} }
@ -1164,7 +1164,8 @@ get_modifier (void)
in_photon = -1; in_photon = -1;
ph_env = getenv ("PHOTON2_PATH"); ph_env = getenv ("PHOTON2_PATH");
if (ph_env != NULL) { if (ph_env != NULL) {
sprintf (phlib_path, "%s/lib/libph.so.1", ph_env); g_snprintf (phlib_path, sizeof (phlib_path),
"%s/lib/libph.so.1", ph_env);
/* QNX 6.x has no support for RTLD_LAZY */ /* QNX 6.x has no support for RTLD_LAZY */
ph_handle = dlopen (phlib_path, RTLD_NOW); ph_handle = dlopen (phlib_path, RTLD_NOW);
if (ph_handle != NULL) { if (ph_handle != NULL) {