Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Rotkraut:Attic
fsplit
fsplit-sanitize.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fsplit-sanitize.diff of Package fsplit
--- fsplit.c.orig 2000-01-23 22:46:02.000000000 +0100 +++ fsplit.c 2010-04-16 14:51:49.653161183 +0200 @@ -44,6 +44,9 @@ static char sccsid[] = "@(#)fsplit.c 5.5 (Berkeley) 3/12/91"; #endif /* not lint */ +#include <stdlib.h> +#include <unistd.h> +#include <string.h> #include <ctype.h> #include <stdio.h> #include <sys/types.h> @@ -80,7 +83,17 @@ char x[]="zzz000.f", mainp[]="main000.f", blkp[]="blkdta000.f"; -char *look(), *skiplab(), *functs(); + +void badparms(void); +int saveit(char *name); +void get_name(char *name, int letters); +int get_input_line(void); +int lend(void); +int lname(char *s); +int scan_name(char *s, char *ptr); +char *functs(char *p); +char *skiplab(char *p); +char *look(char *s, char *m); #define TRUE 1 #define FALSE 0 @@ -93,12 +106,11 @@ #define trim(p) while (*p == ' ' || *p == '\t') p++ -main(argc, argv) -char **argv; +int main(int argc, char **argv) { - register FILE *ofp; /* output file */ - register rv; /* 1 if got card in output file, 0 otherwise */ - register char *ptr; + FILE *ofp; /* output file */ + int rv; /* 1 if got card in output file, 0 otherwise */ + char *ptr; int nflag, /* 1 if got name of subprog., 0 otherwise */ retval, i; @@ -140,7 +152,7 @@ ofp = fopen(x, "w"); nflag = 0; rv = 0; - while (getline() > 0) { + while (get_input_line() > 0) { rv = 1; fprintf(ofp, "%s", buf); if (lend()) /* look for an 'end' statement */ @@ -184,14 +196,13 @@ } } -badparms() +void badparms(void) { fprintf(stderr, "fsplit: usage: fsplit [-e efile] ... [file] \n"); exit(1); } -saveit(name) -char *name; +int saveit(char *name) { int i; char fname[50], @@ -209,11 +220,9 @@ return(0); } -get_name(name, letters) -char *name; -int letters; +void get_name(char *name, int letters) { - register char *ptr; + char *ptr; while (stat(name, &sbuf) >= 0) { for (ptr = name + letters + 2; ptr >= name + letters; ptr--) { @@ -229,9 +238,9 @@ } } -getline() +int get_input_line(void) { - register char *ptr; + char *ptr; for (ptr = buf; ptr < &buf[BSZ]; ) { *ptr = getc(ifp); @@ -248,9 +257,9 @@ } /* return 1 for 'end' alone on card (up to col. 72), 0 otherwise */ -lend() +int lend(void) { - register char *p; + char *p; if ((p = skiplab(buf)) == 0) return (0); @@ -273,11 +282,10 @@ return 0 if comment card, 1 if found name and put in arg string. invent name for unnamed block datas and main programs. */ -lname(s) -char *s; +int lname(char *s) { # define LINESIZE 80 - register char *ptr, *p, *sptr; + char *ptr, *p, *sptr; char line[LINESIZE], *iptr = line; /* first check for comment cards */ @@ -324,8 +332,7 @@ return(1); } -scan_name(s, ptr) -char *s, *ptr; +int scan_name(char *s, char *ptr) { char *sptr; @@ -346,10 +353,9 @@ return(1); } -char *functs(p) -char *p; +char *functs(char *p) { - register char *ptr; + char *ptr; /* look for typed functions such as: real*8 function, character*16 function, character*(*) function */ @@ -374,10 +380,9 @@ /* if first 6 col. blank, return ptr to col. 7, if blanks and then tab, return ptr after tab, else return 0 (labelled statement, comment or continuation */ -char *skiplab(p) -char *p; +char *skiplab(char *p) { - register char *ptr; + char *ptr; for (ptr = p; ptr < &p[6]; ptr++) { if (*ptr == ' ') @@ -393,10 +398,9 @@ /* return 0 if m doesn't match initial part of s; otherwise return ptr to next char after m in s */ -char *look(s, m) -char *s, *m; +char *look(char *s, char *m) { - register char *sp, *mp; + char *sp, *mp; sp = s; mp = m; while (*mp) {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor