Move to new mx_cprng_draw argument ordering
Change-Id: I4221f5301e04fdf2827bcedcdec4fede896f0d27
diff --git a/src/utils/os_fuchsia.c b/src/utils/os_fuchsia.c
index 97c97e6..fc73e14 100644
--- a/src/utils/os_fuchsia.c
+++ b/src/utils/os_fuchsia.c
@@ -153,16 +153,17 @@
if (TEST_FAIL()) return -1;
while (len > 0) {
- mx_ssize_t output_bytes_this_pass = MX_CPRNG_DRAW_MAX_LEN;
+ mx_size_t output_bytes_this_pass = MX_CPRNG_DRAW_MAX_LEN;
if (len < (size_t)output_bytes_this_pass) {
output_bytes_this_pass = len;
}
- output_bytes_this_pass = mx_cprng_draw(buf, output_bytes_this_pass);
- if (output_bytes_this_pass < 0) {
+ mx_size_t bytes_drawn;
+ mx_status_t status = mx_cprng_draw(buf, output_bytes_this_pass, &bytes_drawn);
+ if (status != NO_ERROR) {
abort();
}
- len -= output_bytes_this_pass;
- buf += output_bytes_this_pass;
+ len -= bytes_drawn;
+ buf += bytes_drawn;
}
return 0;
}