From 63d111db2830c273ac06f9063658bb22283b5d2c Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Tue, 27 Aug 2002 17:01:23 +0000 Subject: [PATCH] * editcmd.c (edit_printf): Use g_vsnprintf() instead of sprintf(). --- edit/ChangeLog | 14 +++++++++----- edit/editcmd.c | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/edit/ChangeLog b/edit/ChangeLog index 8b204b3e8..f20b9c106 100644 --- a/edit/ChangeLog +++ b/edit/ChangeLog @@ -1,3 +1,7 @@ +2002-08-27 Andrew V. Samoilov + + * editcmd.c (edit_printf): Use g_vsnprintf() instead of sprintf(). + 2002-08-24 Pavel Roskin * edit-widget.h: Eliminate ERROR_FILE. @@ -165,8 +169,8 @@ * syntax.c (syntax_g_free): New macro to release and NULLify glib allocated memory area(s). (strdup_convert): Rename to ... - (convert): ... this. Don't strdup passed string. - (get_args): Use convert instead of strdup_convert. + (convert): ... this. Don't strdup() passed string. + (get_args): Use convert() instead of strdup_convert(). (free_args): Make it do notning macro. (open_include_file): Eliminate p array. Use glib function to construct error_file_name. Use PATH_SEP instead of '/'; @@ -182,16 +186,16 @@ 2001-12-22 Andrew V. Samoilov - * editcmd.c (edit_goto_cmd): Use g_free to release f. + * editcmd.c (edit_goto_cmd): Use g_free() to release f. (edit_save_file): Use PATH_SEP instead of '/'. Undefine "close" before closing file created by mc_mkstemps. - Define close to mc_close after it - temporary fix. + Define close to mc_close() after it - temporary fix. (sprintf_p): Don't cast (char *) to (unsigned long). * syntax.c (read_one_line): Undo last patch - errno is a function on some systems. Check ferror() status before - everithing else if fgetc returns EOF. + everything else if fgetc() returns EOF. Accept last line without trailing newline. (compare_word_to_right): Don't cast p and q to unsigned long. diff --git a/edit/editcmd.c b/edit/editcmd.c index 049814858..7d9672a5e 100644 --- a/edit/editcmd.c +++ b/edit/editcmd.c @@ -2291,13 +2291,13 @@ int edit_print_string (WEdit * e, const char *s) return i; } -int edit_printf (WEdit * e, const char *fmt,...) +int edit_printf (WEdit * e, const char *fmt, ...) { int i; va_list pa; char s[1024]; va_start (pa, fmt); - sprintf (s, fmt, pa); + g_vsnprintf (s, sizeof (s), fmt, pa); i = edit_print_string (e, s); va_end (pa); return i;