Rev 10 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 10 | Rev 3718 | ||
---|---|---|---|
Line 85... | Line 85... | ||
85 | int i; |
85 | int i; |
86 | char *pp; |
86 | char *pp; |
87 | if(n<1) return; |
87 | if(n<1) return; |
88 | for(i=1,pp=strchr(p,','); i<n && pp!=NULL; i++,pp=strchr(pp+1,',')); |
88 | for(i=1,pp=strchr(p,','); i<n && pp!=NULL; i++,pp=strchr(pp+1,',')); |
89 | if(pp==NULL) *p=0; |
89 | if(pp==NULL) *p=0; |
90 | else |
90 | else ovlstrcpy(p,pp+1); |
91 | } |
91 | } |
92 | 92 | ||
93 | /* modify a string. Bufferlen must be ast least MAX_LINELEN */ |
93 | /* modify a string. Bufferlen must be ast least MAX_LINELEN */ |
94 | void string_modify2(char *start, char *bad_beg, char *bad_end, char *good,...) |
94 | void string_modify2(char *start, char *bad_beg, char *bad_end, char *good,...) |
95 | { |
95 | { |
Line 99... | Line 99... | ||
99 | va_start(vp,good); |
99 | va_start(vp,good); |
100 | vsnprintf(buf,sizeof(buf),good,vp); va_end(vp); |
100 | vsnprintf(buf,sizeof(buf),good,vp); va_end(vp); |
101 | if(strlen(start)-(bad_end-bad_beg)+strlen(buf)>=MAX_LINELEN) |
101 | if(strlen(start)-(bad_end-bad_beg)+strlen(buf)>=MAX_LINELEN) |
102 | bailout(inlen,0,"string too long"); |
102 | bailout(inlen,0,"string too long"); |
103 | strcat(buf,bad_end); |
103 | strcat(buf,bad_end); |
104 |
|
104 | ovlstrcpy(bad_beg,buf); |
105 | } |
105 | } |
106 | 106 | ||
107 | /* strcmp() to be used within qsort(). */ |
107 | /* strcmp() to be used within qsort(). */ |
108 | int _scmp(const void *p1, const void *p2) |
108 | int _scmp(const void *p1, const void *p2) |
109 | { |
109 | { |