silence compiler warning and do better code. no impact as both buffers are same size

This commit is contained in:
Stanislav Shwartsman 2019-11-26 19:04:55 +00:00
parent 36991e9f59
commit cf23a59a55

View File

@ -313,7 +313,7 @@ reparse:
if ((*tmp_buf_ptr == '\n') || (*tmp_buf_ptr == 0))
{
if ((*tmp_buf_prev != '\n') && (*tmp_buf_prev != 0)) {
strncpy(tmp_buf, tmp_buf_prev, sizeof(tmp_buf_prev));
strncpy(tmp_buf, tmp_buf_prev, sizeof(tmp_buf));
tmp_buf[sizeof(tmp_buf) - 1] = '\0';
goto reparse;
}
@ -400,7 +400,7 @@ void bx_get_command(void)
else {
if (bx_infile_stack_index == 0)
dbg_printf("%s", prompt);
strncpy(tmp_buf_prev, tmp_buf, sizeof(tmp_buf));
strncpy(tmp_buf_prev, tmp_buf, sizeof(tmp_buf_prev));
charptr_ret = fgets(tmp_buf, sizeof(tmp_buf), bx_infile_stack[bx_infile_stack_index].fp);
}
#endif