From d520b9f76ff2e39dcec78896f7dc257ea4a1d73a Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Thu, 5 Sep 2002 20:47:12 +0000 Subject: [PATCH] * man2hlp.c (handle_command): Make clear that unsupported command is a warning, not an error. Avoid unsafe strcat(). --- src/ChangeLog | 3 +++ src/man2hlp.c | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2db2128c1..2ccb0f7eb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2002-09-05 Pavel Roskin + * man2hlp.c (handle_command): Make clear that unsupported + command is a warning, not an error. Avoid unsafe strcat(). + * view.c (view_mode_callback): Eliminate, use the default callback. diff --git a/src/man2hlp.c b/src/man2hlp.c index 07fb67b02..f2cc4b1cd 100644 --- a/src/man2hlp.c +++ b/src/man2hlp.c @@ -459,10 +459,10 @@ handle_command (char *buffer) } else { /* Other commands are ignored */ /* There is no memmove on some systems */ - char buf[BUFFER_SIZE]; - strcpy (buf, "Unsupported command "); - strcat (buf, buffer); - print_error (buf); + char warn_str[BUFFER_SIZE]; + strcpy (warn_str, "Warning: unsupported command "); + strncat (warn_str, buffer, sizeof(warn_str)); + print_error (warn_str); return; } }