mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 19:43:23 +00:00
Uemis downloader: minor coding style updates
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
69c5e9adc2
commit
f7eb6f6b58
1 changed files with 8 additions and 10 deletions
8
uemis.c
8
uemis.c
|
@ -80,22 +80,20 @@ static int uemis_convert_base64(char *base64, uint8_t **data)
|
|||
|
||||
len = strlen(base64);
|
||||
datalen = (len / 4 + 1) * 3;
|
||||
if (datalen < 0x123 + 0x25) {
|
||||
if (datalen < 0x123 + 0x25)
|
||||
/* less than header + 1 sample??? */
|
||||
fprintf(stderr, "suspiciously short data block %d\n", datalen);
|
||||
}
|
||||
|
||||
*data = malloc(datalen);
|
||||
if (!*data) {
|
||||
datalen = 0;
|
||||
fprintf(stderr, "Out of memory\n");
|
||||
goto bail;
|
||||
return 0;
|
||||
}
|
||||
decode((unsigned char *)base64, *data, len);
|
||||
|
||||
if (memcmp(*data, "Dive\01\00\00", 7))
|
||||
fprintf(stderr, "Missing Dive100 header\n");
|
||||
|
||||
bail:
|
||||
return datalen;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue