diff options
author | Chris Larson <clarson@kergoth.com> | 2004-11-09 00:36:47 +0000 |
---|---|---|
committer | Chris Larson <clarson@kergoth.com> | 2004-11-09 00:36:47 +0000 |
commit | f96441b9faf769c9ecdd4d338b605ea3d0cc4010 (patch) | |
tree | edb17ec2c4ea13c5acb1c7350957a249a820e28d /pad | |
parent | b6588aa6851fb220cedc387d21c51513ef8d67f4 (diff) |
Disable bk EOLN_NATIVE conversions on all files in packages FILESPATHs, to prevent it screwing up patches.
BKrev: 4190111fA4MuVozAqwE7xOSL9fr-TA
Diffstat (limited to 'pad')
-rw-r--r-- | pad/pad/pad.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/pad/pad/pad.c b/pad/pad/pad.c index e69de29bb2..e81e22504d 100644 --- a/pad/pad/pad.c +++ b/pad/pad/pad.c @@ -0,0 +1,40 @@ +#include <stdio.h> +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> + +int stat(const char *file_name, struct stat *buf); + +int syntax(void) +{ + printf("syntax:\n"); + printf(" pad padnum filename\n"); + return(0); +} + +int main(int argc, char **argv) +{ + FILE *fp; + long int i=0L, padsize=0L; + unsigned char data=0xff; + struct stat fileinfo; + if(argc<3){ + syntax(); + exit(1); + } + if((fp=fopen(argv[2],"a"))==NULL){ + printf("error opening %s.\n",argv[2]); + exit(1); + } + if(stat(argv[2],&fileinfo)!=0){ + printf("error in stat of %s.\n",argv[2]); + exit(1); + } + padsize = strtol(argv[1],NULL,10) - fileinfo.st_size; + for(i=0;i<padsize;i++){ + fwrite(&data,1,1,fp); + } + fclose(fp); + return(0); +} |