aboutsummaryrefslogtreecommitdiff
path: root/src/include/miscadmin.h
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2025-05-08 22:01:25 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2025-05-08 22:01:25 +0300
commitb28c59a6cd089902e66a91e0d0974da34d1c922b (patch)
treeb114ea0f8fa89e2251b80ef7ba13a04ef0a25891 /src/include/miscadmin.h
parent965213d9c56a671086525a65f5427653b4a66350 (diff)
downloadpostgresql-b28c59a6cd089902e66a91e0d0974da34d1c922b.tar.gz
postgresql-b28c59a6cd089902e66a91e0d0974da34d1c922b.zip
Use 'void *' for arbitrary buffers, 'uint8 *' for byte arrays
A 'void *' argument suggests that the caller might pass an arbitrary struct, which is appropriate for functions like libc's read/write, or pq_sendbytes(). 'uint8 *' is more appropriate for byte arrays that have no structure, like the cancellation keys or SCRAM tokens. Some places used 'char *', but 'uint8 *' is better because 'char *' is commonly used for null-terminated strings. Change code around SCRAM, MD5 authentication, and cancellation key handling to follow these conventions. Discussion: https://www.postgresql.org/message-id/61be9e31-7b7d-49d5-bc11-721800d89d64@eisentraut.org
Diffstat (limited to 'src/include/miscadmin.h')
-rw-r--r--src/include/miscadmin.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
index 629772b0381..1e59a7f910f 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -192,7 +192,7 @@ extern PGDLLIMPORT pg_time_t MyStartTime;
extern PGDLLIMPORT TimestampTz MyStartTimestamp;
extern PGDLLIMPORT struct Port *MyProcPort;
extern PGDLLIMPORT struct Latch *MyLatch;
-extern PGDLLIMPORT char MyCancelKey[];
+extern PGDLLIMPORT uint8 MyCancelKey[];
extern PGDLLIMPORT int MyCancelKeyLength;
extern PGDLLIMPORT int MyPMChildSlot;