summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2017-06-28 22:46:19 -0400
committerAlexei Podtelezhnikov <apodtele@gmail.com>2017-06-28 22:46:19 -0400
commit399ea0471284c2433999fbcb2a2df6fa037fbaf2 (patch)
treebbd9e242ff7f94f0346cb229ea8ee82a8a8671ac
parent5dc559238629c9476e9a70543f598b8854a81d1a (diff)
Fix shadows and missing arguments.
-rw-r--r--fondu.c18
-rw-r--r--frommacbinary.c2
-rw-r--r--tomacbinary.c2
3 files changed, 11 insertions, 11 deletions
diff --git a/fondu.c b/fondu.c
index e6be788..e98c913 100644
--- a/fondu.c
+++ b/fondu.c
@@ -473,7 +473,7 @@ static FOND *BuildFondList(FILE *f,long rlistpos,int subcnt,long rdata_pos,
}
if ( styleoff!=0 ) {
unsigned char stringoffsets[48];
- int strcnt, strlen, format;
+ int strcnt, strlength, format;
char **strings, *pt;
fseek(f,styleoff,SEEK_SET);
/* class = */ getushort(f);
@@ -484,11 +484,11 @@ static FOND *BuildFondList(FILE *f,long rlistpos,int subcnt,long rdata_pos,
strcnt = getushort(f);
strings = malloc(strcnt*sizeof(char *));
for ( j=0; j<strcnt; ++j ) {
- strlen = getc(f);
- strings[j] = malloc(strlen+2);
- strings[j][0] = strlen;
- strings[j][strlen+1] = '\0';
- for ( k=0; k<strlen; ++k )
+ strlength = getc(f);
+ strings[j] = malloc(strlength+2);
+ strings[j][0] = strlength;
+ strings[j][strlength+1] = '\0';
+ for ( k=0; k<strlength; ++k )
strings[j][k+1] = getc(f);
}
for ( j=0; j<48; ++j ) {
@@ -498,11 +498,11 @@ static FOND *BuildFondList(FILE *f,long rlistpos,int subcnt,long rdata_pos,
if ( k!=-1 || stringoffsets[j]==0 )
continue; /* this style doesn't exist */
format = stringoffsets[j]-1;
- strlen = strings[0][0];
+ strlength = strings[0][0];
if ( format!=0 && format!=-1 )
for ( k=0; k<strings[format][0]; ++k )
- strlen += strings[ strings[format][k+1]-1 ][0];
- pt = cur->psnames[j] = malloc(strlen+1);
+ strlength += strings[ strings[format][k+1]-1 ][0];
+ pt = cur->psnames[j] = malloc(strlength+1);
strcpy(pt,strings[ 0 ]+1);
pt += strings[ 0 ][0];
if ( format!=0 && format!=-1 )
diff --git a/frommacbinary.c b/frommacbinary.c
index d2d0199..5247b47 100644
--- a/frommacbinary.c
+++ b/frommacbinary.c
@@ -55,7 +55,7 @@ extern unsigned long binhex_crc(unsigned char *buffer,int size);
/* frombin filenames */
static void Usage(char *prog) {
- fprintf( stderr, "Usage: %s [-usage] [-help] [-version] filenames\n" );
+ fprintf( stderr, "Usage: %s [-usage] [-help] [-version] filenames\n", prog );
fprintf( stderr, " -usage\t\tPrints this message\n" );
fprintf( stderr, " -help\t\tPrints this message\n" );
fprintf( stderr, " -version\t\tPrints the version of the program\n" );
diff --git a/tomacbinary.c b/tomacbinary.c
index d76e06e..8e7dc5b 100644
--- a/tomacbinary.c
+++ b/tomacbinary.c
@@ -58,7 +58,7 @@ extern unsigned long binhex_crc(unsigned char *buffer,int size);
/* tobin -res rfilename */
static void Usage(char *prog) {
- fprintf( stderr, "Usage: %s {[-res filename] [-create creat] [-type type] [filename]}\n" );
+ fprintf( stderr, "Usage: %s {[-res filename] [-create creat] [-type type] [filename]}\n", prog );
fprintf( stderr, " -res filename\tProvides the name of a file whose data fork is to\n" );
fprintf( stderr, "\t\t\tplaced in a resource fork\n" );
fprintf( stderr, " -create creat\tProvides a four character creator (if omitted on the\n" );