Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Use json_integer_value() instead of json_number_value()
Browse files Browse the repository at this point in the history
json_number_value() returns a double json_integer_value() returns a
proper 64 bits integer.
  • Loading branch information
Marco van Wieringen committed Jun 25, 2016
1 parent be5637b commit 434494e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vadp_dumper/bareos_vadp_dumper.cpp
Expand Up @@ -815,15 +815,15 @@ static inline bool save_disk_info(const char *key, json_t *cbt, uint64_t *absolu
goto bail_out;
}

rdie.absolute_disk_length = json_number_value(object);
rdie.absolute_disk_length = json_integer_value(object);

object = json_object_get(cbt, CBT_START_OFFSET);
if (!object) {
fprintf(stderr, "Failed to find %s in JSON definition of object %s\n", CBT_START_OFFSET, key);
goto bail_out;
}

rdie.absolute_start_offset = json_number_value(object);
rdie.absolute_start_offset = json_integer_value(object);

/*
* Save the absolute offset we should use.
Expand Down Expand Up @@ -1179,8 +1179,8 @@ static inline bool process_cbt(const char *key, json_t *cbt)
continue;
}

start_offset = json_number_value(start);
offset_length = json_number_value(length);
start_offset = json_integer_value(start);
offset_length = json_integer_value(length);

if (verbose) {
fprintf(stderr, "start = %lld\n", start_offset);
Expand Down

0 comments on commit 434494e

Please sign in to comment.