Changeset bf373f5 in subsurface


Ignore:
Timestamp:
May 4, 2017, 10:37:00 AM (5 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
4ba9781
Parents:
499a792a
git-author:
Olivier Verstraet <O.VERSTRAET@…> (05/01/17 23:40:16)
git-committer:
Dirk Hohndel <dirk@…> (05/04/17 10:37:00)
Message:

Fix calculation of how many samples profile are in datatrack dive log file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/datatrak.c

    r6399eaf rbf373f5  
    640640                 * bytes jumped over (22) and the nitrox (2) or O2 (3).
    641641                 */
    642                 int samplenum = is_O2 ? (profile_length - 25) * 3 / 8 : (profile_length - 24) * 3 / 7;
     642                int numerator = is_O2 ? (profile_length - 25) * 3 : (profile_length - 24) * 3;
     643                int denominator = is_O2 ? 8 : 7;
     644                int samplenum = (numerator / denominator) + (((numerator % denominator) != 0) ? 1 : 0);
    643645
    644646                dc->events = calloc(samplenum, sizeof(struct event));
Note: See TracChangeset for help on using the changeset viewer.