diff options
author | Andrew Konchin <[email protected]> | 2025-05-07 18:49:54 +0300 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2025-05-09 23:22:15 +0200 |
commit | cb4a441819a56a445dbe82921b44f1410c682fc6 () | |
tree | 2316f75a66b41755879eea9d2f018af28935ec15 /spec/ruby/optional/capi/ext | |
parent | 269ad29de95e41cc8a4eede84b98a81a6ff4f7b6 (diff) |
Fix formatting in digest_spec.c
Notes: Merged: https://.com/ruby/ruby/pull/13265
-rw-r--r-- | spec/ruby/optional/capi/ext/digest_spec.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -26,7 +26,7 @@ void* context = NULL; int digest_spec_plugin_init(void *raw_ctx) { // Make the context accessible to tests. This isn't safe, but there's no way to access the context otherwise. context = raw_ctx; - struct CTX *ctx = (struct CTX *)raw_ctx; size_t len = strlen(init_string); @@ -44,7 +44,7 @@ int digest_spec_plugin_init(void *raw_ctx) { void digest_spec_plugin_update(void *raw_ctx, unsigned char *ptr, size_t size) { struct CTX *ctx = (struct CTX *)raw_ctx; size_t update_str_len = strlen(update_string); - if (ctx->pos + update_str_len + size >= PAYLOAD_SIZE) { rb_raise(rb_eRuntimeError, "update size too large; reset the digest and write fewer updates"); } @@ -63,7 +63,7 @@ void digest_spec_plugin_update(void *raw_ctx, unsigned char *ptr, size_t size) { int digest_spec_plugin_finish(void *raw_ctx, unsigned char *ptr) { struct CTX *ctx = (struct CTX *)raw_ctx; size_t finish_string_len = strlen(finish_string); - // We're always going to write DIGEST_LENGTH bytes. In a real plugin, this would be the digest value. Here we // write out a text string in order to make validation in tests easier. // |