}
#endif
- strcpy(command_ps + j, command_ps + j + 1);
+ overlapping_strcpy(command_ps + j, command_ps + j + 1);
command_len--;
input_end(); /* rewrite new line */
cmdedit_set_out_char(' '); /* erase char */
/* NB: do not trash old history if file can't be opened */
- fp = fopen(fromfile, "r");
+ fp = fopen_for_read(fromfile);
if (fp) {
/* clean up old history */
for (hi = state->cnt_history; hi > 0;) {
{
FILE *fp;
- fp = fopen(tofile, "w");
+ fp = fopen_for_write(tofile);
if (fp) {
int i;
vi_case(CTRL('U')|vbit:)
/* Control-U -- Clear line before cursor */
if (cursor) {
- strcpy(command, command + cursor);
+ overlapping_strcpy(command, command + cursor);
command_len -= cursor;
redraw(cmdedit_y, command_len);
}