projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6c70f6
)
Add pg_nodiscard decorations to base64 functions
author
Peter Eisentraut
<
[email protected]
>
Fri, 17 Jan 2025 07:06:24 +0000
(08:06 +0100)
committer
Peter Eisentraut
<
[email protected]
>
Fri, 17 Jan 2025 07:21:32 +0000
(08:21 +0100)
The result of pg_b64_encode() and pg_b64_decode() should be checked
for errors. This attribute could detect mistakes such as those fixed
in commit
ff030ebe250
and
d278541be42
.
Reviewed-by: Michael Paquier <
[email protected]
>
Reviewed-by: Ranier Vilela <
[email protected]
>
Discussion: https://www.postgresql.org/message-id/flat/CAEudQAq-3yHsSdWoOOaw%2BgAQYgPMpMGuB5pt2yCXgv-YuxG2Hg%40mail.gmail.com
src/include/common/base64.h
patch
|
blob
|
blame
|
history
diff --git
a/src/include/common/base64.h
b/src/include/common/base64.h
index 2d88d31c874b02d002616c575a1a3ab697644c44..b064275bbb438f5a3c60da39507aded625186768 100644
(file)
--- a/
src/include/common/base64.h
+++ b/
src/include/common/base64.h
@@
-11,8
+11,8
@@
#define BASE64_H
/* base 64 */
-extern int pg_b64_encode(const char *src, int len, char *dst, int dstlen);
-extern int pg_b64_decode(const char *src, int len, char *dst, int dstlen);
+extern
pg_nodiscard
int pg_b64_encode(const char *src, int len, char *dst, int dstlen);
+extern
pg_nodiscard
int pg_b64_decode(const char *src, int len, char *dst, int dstlen);
extern int pg_b64_enc_len(int srclen);
extern int pg_b64_dec_len(int srclen);