home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <stdlib.h>
- #include <iostream.h>
- #pragma argsused
-
- void main( int argc, char *argv[] )
- {
- int fart = atoi(argv[3]);
- unsigned long die = atol(argv[2]);
- if (argv[1] == NULL)
- {cout <<"No File Name!\n";exit(1);}
- if(argv[2] == NULL)
- {cout << "No offset specified, or invalid offset specified!";exit(1);}
- if(argv[3] == NULL)
- {cout << "No character specified!";exit(1);}
- if((fart > 255) || (fart < 0))
- {cout <<"Invalid character number";exit(1);}
- FILE *stream;
- if ((stream = fopen(argv[1], "r+b"))== NULL)
- {cout<<"Error opening target file";
- exit(1);}
- fseek(stream,die,0);
- fprintf(stream, "%c", fart);
- fclose(stream);}
-
-