Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 272fc79

Browse filesBrowse files
RaisinTencodebytere
authored andcommitted
crypto: fix format warning in AdditionalConfig
Fixes warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘size_t {aka unsigned int}` Co-authored-by: Anna Henningsen <github@addaleax.net> PR-URL: #36060 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 27f1bc0 commit 272fc79
Copy full SHA for 272fc79

File tree

Expand file treeCollapse file tree

1 file changed

+6
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-5
lines changed
Open diff view settings
Collapse file

‎src/crypto/crypto_keygen.cc‎

Copy file name to clipboardExpand all lines: src/crypto/crypto_keygen.cc
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "allocated_buffer-inl.h"
33
#include "async_wrap-inl.h"
44
#include "base_object-inl.h"
5+
#include "debug_utils-inl.h"
56
#include "env-inl.h"
67
#include "memory_tracker-inl.h"
78
#include "threadpoolwork-inl.h"
@@ -67,11 +68,11 @@ Maybe<bool> SecretKeyGenTraits::AdditionalConfig(
6768
CHECK(args[*offset]->IsUint32());
6869
params->length = std::trunc(args[*offset].As<Uint32>()->Value() / CHAR_BIT);
6970
if (params->length > INT_MAX) {
70-
char msg[1024];
71-
snprintf(msg, sizeof(msg),
72-
"length must be less than or equal to %lu bits",
73-
static_cast<size_t>(INT_MAX) * CHAR_BIT);
74-
THROW_ERR_OUT_OF_RANGE(env, msg);
71+
const std::string msg{
72+
SPrintF("length must be less than or equal to %s bits",
73+
static_cast<uint64_t>(INT_MAX) * CHAR_BIT)
74+
};
75+
THROW_ERR_OUT_OF_RANGE(env, msg.c_str());
7576
return Nothing<bool>();
7677
}
7778
*offset += 1;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.