Index: main.c =================================================================== --- main.c (wersja 186838) +++ main.c (kopia robocza) @@ -669,7 +669,7 @@ struct stat st; FILE *fp, *pp; int error, len, osz, r; - unsigned int off, size; + unsigned int i, off, size; char *cmd, *o; r = open(file, O_RDONLY); @@ -707,7 +707,17 @@ r = fseek(fp, off, SEEK_CUR); if (r != 0) errx(EXIT_FAILURE, "fseek() failed"); - while ((r = fgetc(fp)) != EOF && size-- > 0) + for (i = 0; i < size - 1; i++) { + r = fgetc(fp); + if (r == EOF) + break; + /* + * If 'r' is somehow present in the configuration + * string, compain just like grep(1) will do. + */ + assert(r != 0 && ("Char present in the configuration string" + " mustn't be equal to 0")); fputc(r, stdout); + } fclose(fp); }