Skip to content

Commit b0eff10

Browse files
committed
Add pg_nodiscard decorations to base64 functions
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 ff030eb and d278541. Reviewed-by: Michael Paquier <michael@paquier.xyz> Reviewed-by: Ranier Vilela <ranier.vf@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/CAEudQAq-3yHsSdWoOOaw%2BgAQYgPMpMGuB5pt2yCXgv-YuxG2Hg%40mail.gmail.com
1 parent a6c70f6 commit b0eff10

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/include/common/base64.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#define BASE64_H
1212

1313
/* base 64 */
14-
extern int pg_b64_encode(const char *src, int len, char *dst, int dstlen);
15-
extern int pg_b64_decode(const char *src, int len, char *dst, int dstlen);
14+
extern pg_nodiscard int pg_b64_encode(const char *src, int len, char *dst, int dstlen);
15+
extern pg_nodiscard int pg_b64_decode(const char *src, int len, char *dst, int dstlen);
1616
extern int pg_b64_enc_len(int srclen);
1717
extern int pg_b64_dec_len(int srclen);
1818

0 commit comments

Comments
 (0)