안시 문자열로 인한 공백 #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 | 개량형 우체국 | 그리움 | 2007.04.12 | 230 |
36 | 기술추가 | 그리움 | 2007.04.12 | 246 |
» | 안시 문자열로 인한 공백 #2 | 그리움 | 2007.04.12 | 242 |
34 | 지도 기능 | 그리움 | 2007.04.12 | 219 |
33 | 안시 사용하기 | 그리움 | 2007.04.12 | 209 |
32 | 분신을 만드는 기술 | 그리움 | 2007.04.12 | 221 |
31 | 방설명 안시 넣기 | 그리움 | 2007.04.12 | 212 |
30 | 패거리 전쟁 승패 기록 | 그리움 | 2007.04.12 | 210 |
29 | 접속화면을 멋있게 | 그리움 | 2007.04.12 | 197 |
28 | 패거리 직위 내리기 | 그리움 | 2007.04.12 | 200 |
27 | 이도류 | 그리움 | 2007.04.12 | 237 |
26 | 안시 문자열로 인한 공백 | 그리움 | 2007.04.12 | 230 |
25 | 자동으로 돈줍기 #2 | 그리움 | 2007.04.12 | 237 |
24 | 자동 이벤트 | 그리움 | 2007.04.12 | 242 |
23 | 낮과 밤이 되면 어둡고 환하게 | 그리움 | 2007.04.12 | 241 |
22 | 직업 추가하기 #2 | 그리움 | 2007.04.12 | 233 |
21 | 경매는 이렇게 | 그리움 | 2007.04.12 | 250 |
20 | 패거리전쟁중 "휴전" | 그리움 | 2007.04.12 | 257 |
19 | 도배방지 | 그리움 | 2007.04.12 | 266 |
18 | 직업 추가하기 | 그리움 | 2007.04.12 | 254 |