svnno****@sourc*****
svnno****@sourc*****
2011年 3月 17日 (木) 19:12:07 JST
Revision: 4388 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4388 Author: yutakapon Date: 2011-03-17 19:12:07 +0900 (Thu, 17 Mar 2011) Log Message: ----------- strremoveã«ããæååå¤æ°æä½ã§ ä¾ã¨ã㦠130ãã¤ãæååã®æå¾å°¾1æåãåé¤ããã㨠æä½å¯¾è±¡æååã®æ¬¡ã«å®£è¨ãããæååã®å é ãæ¸ãæãããã¦ãã¾ãã http://sourceforge.jp/ticket/browse.php?group_id=1412&tid=24631 ã¨ããåé¡ã«å¯¾ããä¿®æ£ãè¡ã£ãã Modified Paths: -------------- trunk/teraterm/ttpmacro/ttl.c -------------- next part -------------- Modified: trunk/teraterm/ttpmacro/ttl.c =================================================================== --- trunk/teraterm/ttpmacro/ttl.c 2011-03-15 13:09:19 UTC (rev 4387) +++ trunk/teraterm/ttpmacro/ttl.c 2011-03-17 10:12:07 UTC (rev 4388) @@ -3661,7 +3661,7 @@ static void remove_string(char *str, int index, int len) { char *np; - int srclen; + int srclen, copylen; srclen = strlen(str); @@ -3669,8 +3669,23 @@ return; } + /* + remove_string(str, 6, 4); + + <------------>srclen + <-->len + XXXXXX****YYY + ^index(np) + ^np+len + <-->srclen - len - index + « + XXXXXXYYY + */ + np = str + (index - 1); - memmove_s(np, MaxStrLen, np + len, srclen - len); + copylen = srclen - len - (index - 1); + if (copylen > 0) + memmove_s(np, MaxStrLen, np + len, copylen); // null-terminate str[srclen - len] = '\0';