Rev 8647 | Rev 8863 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8647 | Rev 8861 | ||
---|---|---|---|
Line 713... | Line 713... | ||
713 | if(ln+le+(bad_beg-start)>=MAX_LINELEN) { |
713 | if(ln+le+(bad_beg-start)>=MAX_LINELEN) { |
714 | error("string_too_long"); return; |
714 | error("string_too_long"); return; |
715 | } |
715 | } |
716 | if(ln!=bad_end-bad_beg) memmove(bad_beg+ln,bad_end,le+1); |
716 | if(ln!=bad_end-bad_beg) memmove(bad_beg+ln,bad_end,le+1); |
717 | memmove(bad_beg,buf,ln); |
717 | memmove(bad_beg,buf,ln); |
- | 718 | } |
|
- | 719 | ||
- | 720 | /* modify a string. Bufferlen must be at least MAX_LINELEN */ |
|
- | 721 | void string_modify3(char *start, char *bad_beg, char *bad_end, char *good,...) |
|
- | 722 | { |
|
- | 723 | char buf[MAX_LINELEN+1]; |
|
- | 724 | va_list vp; |
|
- | 725 | ||
- | 726 | va_start(vp,good); |
|
- | 727 | vsnprintf(buf,sizeof(buf),good,vp); va_end(vp); |
|
- | 728 | if(strlen(start)-(bad_end-bad_beg)+strlen(buf)>=MAX_LINELEN) |
|
- | 729 | return; /* this is an error situation. */ |
|
- | 730 | strcat(buf,bad_end); |
|
- | 731 | ovlstrcpy(bad_beg,buf); |
|
718 | } |
732 | } |
719 | 733 | ||
720 | /* returns number of bytes written */ |
734 | /* returns number of bytes written */ |
721 | int catfile(FILE *outf, char *fn,...) |
735 | int catfile(FILE *outf, char *fn,...) |
722 | { |
736 | { |