Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int scan_strings(FILE *in, FILE *out)
- {
- char buffer[64];
- int i = 0, n = 0;
- for(;;)
- {
- if (fscanf(in, "%*[^" charset "]") != EOF)
- {
- i = 0;
- while (fscanf(in, "%63[" charset "]%n", buffer, &n) == 1)
- {
- if (n < 4 && i == 0)
- {
- break;
- }
- else
- {
- i = 1;
- }
- fputs(buffer, out);
- }
- if (i != 0)
- {
- putc('n', out);
- }
- }
- if (feof(in))
- {
- return 0;
- }
- if (ferror(in) || ferror(out))
- {
- return -1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement