作者ric2k1 (Ric)
看板EE_DSnP
标题[公告] modCalc.ref and cmdCommon.cpp bug fix
时间Wed Apr 9 22:48:37 2008
※ 引述《bnsblue (想当你的天空)》之铭言:
: 在使用modCalc.ref的时候
: 就是在结束的时候会询问一个是否确定的问题
: default是[No]
: 可是在这时候如果直接按enter会有如下的错误
: terminate called after throwing an instance of 'std::out_of_range'
: what(): basic_string::substr
: Aborted
: 请问这要怎麽办呢?
[Note: It is OK if you don't update this bug fix. We will not test this part]
Bug fix (cmdCommon.cpp):
=======================
[OLD]
80 size_t s = ss.find_first_not_of(' ', 0);
81 ss = ss.substr(s);
82 if (myStrNCmp("Yes", ss, 1) == 0)
83 return CMD_EXEC_QUIT; // ready to quit
84 return CMD_EXEC_DONE; // not yet to quit
[NEW]
80 size_t s = ss.find_first_not_of(' ', 0);
81 if (s != string::npos) {
82 ss = ss.substr(s);
83 if (myStrNCmp("Yes", ss, 1) == 0)
84 return CMD_EXEC_QUIT; // ready to quit
85 }
86 return CMD_EXEC_DONE; // not yet to quit
Please:
1. Add those two GREEN lines in your cmdCommon.cpp, or download hw3.tgz again.
2. Upload new modCalc.ref
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.121.140.242