안시 문자열로 인한 공백 #2
2007.04.12 12:59
#define MAXLINE 77
void delimit(str)
char *str;
{
int i, j, l, len, lastspace;
char str2[2048];
str2[0] = 0;
j = (str) ? strlen(str) : 0;
if(j < MAXLINE)
return;
len = 0; lastspace = -1; l = 0;
for(i=0; i if(str[i] == ' ')
lastspace = i;
if(str[i] == '\n') {
len = 0;
lastspace = -1;
}
if(str[i] == 0x1b ) {
len -= 7;
}
len++;
if(len > MAXLINE && lastspace > -1) {
str[lastspace] = 0;
strcat(str2, &str[l]);
strcat(str2, "\n ");
l = lastspace + 1;
len = i - lastspace + 3;
lastspace = -1;
}
}
strcat(str2, &str[l]);
strcpy(str, str2);
}
저번 소스에서 for문이 잘못해서 누락되었던것을 수정한것입니다.
홈지기 "그리움"
void delimit(str)
char *str;
{
int i, j, l, len, lastspace;
char str2[2048];
str2[0] = 0;
j = (str) ? strlen(str) : 0;
if(j < MAXLINE)
return;
len = 0; lastspace = -1; l = 0;
for(i=0; i if(str[i] == ' ')
lastspace = i;
if(str[i] == '\n') {
len = 0;
lastspace = -1;
}
if(str[i] == 0x1b ) {
len -= 7;
}
len++;
if(len > MAXLINE && lastspace > -1) {
str[lastspace] = 0;
strcat(str2, &str[l]);
strcat(str2, "\n ");
l = lastspace + 1;
len = i - lastspace + 3;
lastspace = -1;
}
}
strcat(str2, &str[l]);
strcpy(str, str2);
}
저번 소스에서 for문이 잘못해서 누락되었던것을 수정한것입니다.
홈지기 "그리움"
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
37 | 레벨을 32767까지 가능하게 | 그리움 | 2007.04.12 | 200 |
36 | 암호 *****로 보이게 하기 | 그리움 | 2007.04.12 | 181 |
35 | 게시판 검색 기능 추가하기 | 그리움 | 2007.04.12 | 170 |
34 | 출구 정렬 | 그리움 | 2007.04.12 | 186 |
33 | 귀환장소 설정 | 그리움 | 2007.04.12 | 190 |
32 | 패거리 상점 만들기 | 그리움 | 2007.04.12 | 163 |
31 | Ctrl+Enter 패치하기 | 그리움 | 2007.04.12 | 161 |
30 | 글자색, 배경색 15색 사용하기 | 그리움 | 2007.04.12 | 173 |
29 | 경매 소스 | 그리움 | 2007.04.12 | 180 |
28 | 이동력 추가하기 | 그리움 | 2007.04.12 | 188 |
27 | 자기 아파트 방설명은 자기가 #2 | 그리움 | 2007.04.12 | 182 |
26 | 명성치 도입 | 그리움 | 2007.04.12 | 187 |
25 | 개량형 우체국 | 그리움 | 2007.04.12 | 177 |
24 | 순위 소스 | 그리움 | 2007.04.12 | 174 |
23 | 패거리 전쟁시 적과 아군 구분 | 그리움 | 2007.04.12 | 165 |
22 | 몹과 자신을 "비교" | 그리움 | 2007.04.12 | 171 |
21 | 특수 아이템 만들기 | 그리움 | 2007.04.12 | 209 |
20 | 개척 소스 | 그리움 | 2007.04.12 | 302 |
19 | 머드에서 몹 심기 | 그리움 | 2007.04.12 | 287 |
18 | 이동하는 몹 | 그리움 | 2007.04.12 | 283 |