* man2hlp.c (handle_command): Make clear that unsupported

command is a warning, not an error.  Avoid unsafe strcat().
This commit is contained in:
Pavel Roskin 2002-09-05 20:47:12 +00:00
parent cac0accb55
commit d520b9f76f
2 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,8 @@
2002-09-05 Pavel Roskin <proski@gnu.org>
* 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.

View File

@ -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;
}
}