Skip to content

Commit

Permalink
Merge pull request #1 from kmkaplan/master
Browse files Browse the repository at this point in the history
Please apply this small fix
  • Loading branch information
wuyongzheng committed Aug 10, 2012
2 parents 3d984d0 + f43d132 commit 3920965
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ all: gimginfo gimgfixcmd gimgxor gimgunlock gimgch gimgextract cmdc
gimginfo: gimginfo.o $(GIMGLIB_OBJS)

gimgfixcmd: gimgfixcmd.o cmdlib.o $(GIMGLIB_OBJS)
$(CC) -o $@ -lm $^
$(CC) -o $@ $^ -lm

gimgxor: gimgxor.o

Expand All @@ -19,7 +19,7 @@ gimgch: gimgch.o
gimgextract: gimgextract.o

cmdc: cmdc.o
$(CC) -o $@ -lm $<
$(CC) -o $@ $< -lm

.PHONY: clean
clean:
Expand Down
2 changes: 1 addition & 1 deletion cmdlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ short *cmd_devs = NULL;
int cmd_init (const char *path)
{
FILE *fp = fopen(path, "rb");
if (fopen == NULL) {
if (fp == NULL) {
printf("cannot open %s\n", path);
goto errout;
}
Expand Down
1 change: 1 addition & 0 deletions gimglib.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# include <stdlib.h>
# include <assert.h>
# include <string.h>
# include <strings.h>
# include <sys/mman.h>
# include <sys/stat.h>
# include <unistd.h>
Expand Down
6 changes: 3 additions & 3 deletions gimgunlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ int read_byte_at (FILE *fp, unsigned long offset)
return getc(fp);
}

int read_2byte_at (FILE *fp, unsigned long offset)
unsigned int read_2byte_at (FILE *fp, unsigned long offset)
{
int n = 0;
unsigned int n = 0;
if (fseek(fp, offset, SEEK_SET)) {
perror(NULL);
exit(1);
Expand All @@ -87,7 +87,7 @@ int read_2byte_at (FILE *fp, unsigned long offset)

unsigned int read_4byte_at (FILE *fp, unsigned long offset)
{
int n = 0;
unsigned int n = 0;
if (fseek(fp, offset, SEEK_SET)) {
perror(NULL);
exit(1);
Expand Down
2 changes: 1 addition & 1 deletion sf_gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void dump_gmp (struct subfile_struct *sf)
printf("unknown_02d: 0x%x\n", header->unknown_02d);

if (header->comm.hlen > sizeof(struct garmin_gmp))
printf("from 0x%x to 0x%x (0x%x bytes): %s\n",
printf("from 0x%lx to 0x%x (0x%lx bytes): %s\n",
sizeof(struct garmin_gmp), header->comm.hlen - 1,
header->comm.hlen - sizeof(struct garmin_gmp),
dump_unknown_bytes((uint8_t *)header + sizeof(struct garmin_gmp), header->comm.hlen - sizeof(struct garmin_gmp)));
Expand Down

0 comments on commit 3920965

Please sign in to comment.