From 3fb2fd57f33e3c4f23d18bad4dabcfe4d03ddcf0 Mon Sep 17 00:00:00 2001 From: Michael Jennings Date: Fri, 7 Nov 2003 17:28:42 +0000 Subject: [PATCH] Fri Nov 7 12:26:11 2003 Michael Jennings (mej) Fixed stupid mathematical blunder in the font handling code pointed out by Laurence J. Lane . Allow save_buff() script function to dump to stderr if no file is specified. Note that script functions CANNOT be triggered by escape sequences. SVN revision: 7818 --- ChangeLog | 9 +++++++++ src/options.c | 8 ++++---- src/script.c | 2 ++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 38a4e83..6e9902b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5117,3 +5117,12 @@ Changed -D/--desktop option to use EWMH-compliant desktop atom. Add support for EWMH icon property. ---------------------------------------------------------------------- +Fri Nov 7 12:26:11 2003 Michael Jennings (mej) + +Fixed stupid mathematical blunder in the font handling code pointed +out by Laurence J. Lane . + +Allow save_buff() script function to dump to stderr if no file is +specified. Note that script functions CANNOT be triggered by escape +sequences. +---------------------------------------------------------------------- diff --git a/src/options.c b/src/options.c index caf54f2..339fd0a 100644 --- a/src/options.c +++ b/src/options.c @@ -979,7 +979,7 @@ parse_attributes(char *buff, void *state) } else if (!BEG_STRCASECMP(buff, "font ")) { char *tmp = get_pword(2, buff); - unsigned char n; + unsigned long n; if (!BEG_STRCASECMP(tmp, "fx ") || !BEG_STRCASECMP(tmp, "effect")) { if (parse_font_fx(get_pword(2, tmp)) != 1) { @@ -997,7 +997,7 @@ parse_attributes(char *buff, void *state) file_peek_path(), file_peek_line()); } } else if (isdigit(*tmp)) { - n = (unsigned char) strtoul(tmp, (char **) NULL, 0); + n = strtoul(tmp, (char **) NULL, 0); if (n <= 255) { eterm_font_add(&etfonts, get_pword(2, tmp), n); } else { @@ -2351,7 +2351,7 @@ parse_multichar(char *buff, void *state) } else if (!BEG_STRCASECMP(buff, "font ")) { char *tmp = get_pword(2, buff); - unsigned char n; + unsigned long n; if (num_words(buff) != 3) { print_error("Parse error in file %s, line %lu: Invalid parameter list \"%s\" for attribute font\n", @@ -2359,7 +2359,7 @@ parse_multichar(char *buff, void *state) return NULL; } if (isdigit(*tmp)) { - n = (unsigned char) strtoul(tmp, (char **) NULL, 0); + n = strtoul(tmp, (char **) NULL, 0); if (n <= 255) { eterm_font_add(&etmfonts, get_pword(2, tmp), n); } else { diff --git a/src/script.c b/src/script.c index 8e97de3..123def6 100644 --- a/src/script.c +++ b/src/script.c @@ -316,6 +316,8 @@ script_handler_save_buff(char **params) { if (params && *params) { scr_dump_to_file(params[0]); + } else { + scr_dump(); } }