The reason was simple. We played with variable work_dir when we draw
the screen and left along. Then, in the next iteration, realloc() was
upset because we gave the changed wrong address as the first argument.
this is very good example why we should reduce global variables to
play with. very nasty code.
Signed-off-by: Yasushi SHOJI <[EMAIL PROTECTED]>
---
Sorry to be late for such a simple fix. I was on a bussiness trip for
a while. anyway here is a fix.
src/file.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Index: minicom-2.2/src/file.c
===================================================================
--- minicom-2.2.orig/src/file.c 2007-04-20 20:26:42.000000000 +0900
+++ minicom-2.2/src/file.c 2007-04-20 20:29:07.000000000 +0900
@@ -366,14 +366,15 @@
new_dp_len = mbslen (work_dir);
if (new_dp_len + (fmt_len = mbslen(cwd_str_fmt)) > 75) {
size_t i;
+ char *tmp_dir = work_dir;
/* We want the last 73 characters */
for (i = 0; 73 + i < new_dp_len + fmt_len; i++) {
wchar_t wc;
- work_dir += one_mbtowc(&wc, work_dir, MB_LEN_MAX);
+ tmp_dir += one_mbtowc(&wc, tmp_dir, MB_LEN_MAX);
}
- snprintf(disp_dir, sizeof(disp_dir), "...%s", work_dir);
+ snprintf(disp_dir, sizeof(disp_dir), "...%s", tmp_dir);
snprintf(cwd_str, sizeof(cwd_str), cwd_str_fmt, disp_dir);
} else
snprintf(cwd_str, sizeof(cwd_str), cwd_str_fmt, work_dir);
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]