Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please apply this small fix #1

Merged
merged 6 commits into from
Aug 10, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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