diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-07-06 13:59:14 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-06 13:59:14 -0700 |
commit | b1538c809d0ce5abe489822f9d2b21287a0a38d5 (patch) | |
tree | 303fbcb44fbd14d0039293cdc7e9a34e8b2424ba /datatrak.c | |
parent | e76675d4df466448a33532895dd371aa498a0e49 (diff) | |
download | subsurface-b1538c809d0ce5abe489822f9d2b21287a0a38d5.tar.gz |
Code cleanup
Make precedence of && over || explicit.
Explicitly convert between char * and unsigned char *.
Don't assign potentially negative return code to an unsigend variable.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'datatrak.c')
-rw-r--r-- | datatrak.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/datatrak.c b/datatrak.c index 414195c2b..c2764b4ef 100644 --- a/datatrak.c +++ b/datatrak.c @@ -62,7 +62,7 @@ static unsigned char to_8859(unsigned char char_cp850) static char *to_utf8(unsigned char *in_string) { int outlen, inlen, i = 0, j = 0; - inlen = strlen(in_string); + inlen = strlen((char *)in_string); outlen = inlen * 2 + 1; char *out_string = calloc(outlen, 1); @@ -165,8 +165,8 @@ static struct dive dt_dive_parser(FILE *archivo, struct dive *dt_dive) char *tmp_notes_str = NULL; unsigned char *tmp_string1 = NULL, *locality = NULL, - *dive_point = NULL, - buffer[1024]; + *dive_point = NULL; + char buffer[1024]; struct divecomputer *dc = &dt_dive->dc; is_nitrox = is_O2 = is_SCR = 0; @@ -475,7 +475,7 @@ static struct dive dt_dive_parser(FILE *archivo, struct dive *dt_dive) read_bytes(1); if (tmp_1byte != 0) { read_string(tmp_string1); - dt_dive->buddy = strdup(tmp_string1); + dt_dive->buddy = strdup((char *)tmp_string1); free(tmp_string1); } |