X-Git-Url: https://git.ao2.it/visomat-utils.git/blobdiff_plain/6d26d073abb2eed23a21d87058b8d6eb0e8d2112..8d67f9a624e9097a7c99513dd0e73daf3b59ae8d:/src/visomat-data-downloader.c diff --git a/src/visomat-data-downloader.c b/src/visomat-data-downloader.c index c2b8590..97da8e8 100644 --- a/src/visomat-data-downloader.c +++ b/src/visomat-data-downloader.c @@ -156,6 +156,13 @@ static int decode_eeprom(unsigned char *buffer, /* user_id and num_records take 3 bytes */ i += 3; + /* + * when there are no records, there is a dummy byte + * which has to be consumed + */ + if (num_records == 0) + i += 1; + for (j = 0; j < num_records; j++) { ret = extract_datetime(buffer + i, &d); if (ret < 0)