From 46d33884f2f1061ae1a77c26928f97d573e57c6c Mon Sep 17 00:00:00 2001 From: rcyeske Date: Fri, 2 Mar 2001 06:06:23 +0000 Subject: * ratpoison.h (xmalloc, xrealloc, fatal): Prototype. * main.c (xmalloc): Move here from sbuf.c. (xrealloc): Likewise. (fatal): Likewise. * number.c (find_empty_cell): Use xrealloc, remove error check. (init_numbers): Likewise. * manage.c (get_window_name): Likewise. * main.c (main): Likewise. * list.c (add_to_window_list): Likewise. (add_to_window_list): Likewise. * events.c (handle_key): Likewise. * input.c (keysym_to_string): Likewise. (get_more_input): Use xrealloc, remove error check. * main.c (read_rc_file): Take a file pointer rather than a filename. (read_startup_files): If ~/.ratpoisonrc is not readable try /etc/ratpoisonrc. --- src/events.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/events.c') diff --git a/src/events.c b/src/events.c index 9bc29e6..7e68c14 100644 --- a/src/events.c +++ b/src/events.c @@ -318,12 +318,8 @@ handle_key (screen_info *s) else { keysym_name = keysym_to_string (keysym, mod); - msg = (char *) malloc ( strlen ( keysym_name ) + 20 ); - if ( msg == NULL ) - { - PRINT_ERROR ("Out of memory\n"); - exit (EXIT_FAILURE); - } + msg = (char *) xmalloc ( strlen ( keysym_name ) + 20 ); + snprintf (msg, strlen (keysym_name) + 13, "%s unbound key!", keysym_name); free (keysym_name); -- cgit v1.2.3