看板 PttBug 關於我們 聯絡資訊
我不知道有沒有po錯板 目前ptt trunk 裡talk.c draw_pickup中的以下程式碼 列出使用者的地方 2034 vs_cols(ulist_coldef, cols, ULISTCOLS, 2035 num, pager, 2036 fcolor[state] ? xuid : uentp->userid, 2037 uentp->nickname, 2038 descript(show_mode, uentp, 2039 uentp->pager & !(friend & HRM), description, sizeof(description)), 2040 #if defined(SHOWBOARD) && defined(DEBUG) 2041 show_board ? (uentp->brc_id == 0 ? "" : 2042 getbcache(uentp->brc_id)->brdname) : 2043 #endif 2044 modestring(uentp, 0), 2045 *mind ? xmind : "", 2046 #ifdef SHOW_IDLE_TIME 2047 idlestr 2048 #else 2049 "" 2050 #endif 2051 ); 因為 1860 #define ULISTCOLS (9) 所以傳給vs_cols的參數 從num開始算應該要有九個對吧? 相較之下 稍早出現的列出標題的片段: 1920 vs_cols(ulist_coldef, cols, ULISTCOLS, 1921 show_uid ? "UID" : "編號", 1922 "P", "代號", "暱稱", 1923 MODE_STRING[show_mode], 1924 show_board ? "看板" : "動態", 1925 // because this field has ANSI... 1926 show_pid ? "PID" : "心情", 1927 #ifdef SHOW_IDLE_TIME 1928 "發呆", 1929 #else 1930 " ", 1931 #endif 1932 ""); 就有九個參數 因為"發呆"對應的是 idlestr 所以列出使用者的地方應該是少參數吧 我把 2046 #ifdef SHOW_IDLE_TIME 2047 idlestr 2048 #else 2049 "" 2050 #endif 2051 ); 改成 2046 #ifdef SHOW_IDLE_TIME 2047 idlestr, 2048 #else 2049 "", 2050 #endif 2051 "" ); 就可以work了 要不然原本vs_cols裡迴圈讀到i=8時 s = va_arg(ap, char*); 會讓s讀到不該讀的記憶體 有時會有bad memory access 希望我沒有想錯~ 謝謝 附上patch ################################################## diff --git a/mbbsd/talk.c b/mbbsd/talk.c index d8f619c..c0e62d5 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -2044,10 +2044,11 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way, modestring(uentp, 0), *mind ? xmind : "", #ifdef SHOW_IDLE_TIME - idlestr + idlestr, #else - "" + "", #endif + "" ); } } ################################################### -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.110.203.61 ※ 編輯: x4base 來自: 140.110.203.61 (03/19 16:12)