안시 문자열로 인한 공백 #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 | 직업 추가하기 #2 | 그리움 | 2007.04.12 | 199 |
35 | 이도류 | 그리움 | 2007.04.12 | 199 |
34 | 기술추가 | 그리움 | 2007.04.12 | 199 |
33 | 귀환장소 변경소스 #2 | 그리움 | 2007.04.12 | 198 |
32 | 베팅소스 | 그리움 | 2007.04.12 | 198 |
31 | 방 전체공격 소스 | 그리움 | 2007.04.12 | 197 |
30 | 자동으로 돈줍기 #2 | 그리움 | 2007.04.12 | 197 |
29 | 패거리 레벨 조정 소스 | 그리움 | 2007.04.12 | 195 |
28 | 자기 아파트 자기가 방설명 넣기 | 그리움 | 2007.04.12 | 195 |
27 | 지도 소스 #2 | 그리움 | 2007.04.12 | 195 |
26 | 패거리창고 소스 | 그리움 | 2007.04.12 | 194 |
25 | 안시 문자열로 인한 공백 | 그리움 | 2007.04.12 | 193 |
24 | 배경색 바꾸기 | 그리움 | 2007.04.12 | 192 |
» | 안시 문자열로 인한 공백 #2 | 그리움 | 2007.04.12 | 191 |
22 | 귀환장소 설정 | 그리움 | 2007.04.12 | 190 |
21 | 이동력 추가하기 | 그리움 | 2007.04.12 | 188 |
20 | 명성치 도입 | 그리움 | 2007.04.12 | 187 |
19 | 출구 정렬 | 그리움 | 2007.04.12 | 186 |
18 | 분신을 만드는 기술 | 그리움 | 2007.04.12 | 183 |