Skip to content

Commit fcb906b

Browse files
committed
Add missing null char to options
1 parent b6ba4b3 commit fcb906b

File tree

2 files changed

+64
-64
lines changed

2 files changed

+64
-64
lines changed

build.rs

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,40 +26,40 @@ fn generate_lib() {
2626
#![allow(non_camel_case_types)]
2727
#![allow(non_snake_case)]
2828
29-
pub const NNG_OPT_SOCKNAME: &[u8] = b\"socket-name\";
30-
pub const NNG_OPT_RAW: &[u8] = b\"raw\";
31-
pub const NNG_OPT_PROTO: &[u8] = b\"protocol\";
32-
pub const NNG_OPT_PROTONAME: &[u8] = b\"protocol-name\";
33-
pub const NNG_OPT_PEER: &[u8] = b\"peer\";
34-
pub const NNG_OPT_PEERNAME: &[u8] = b\"peer-name\";
35-
pub const NNG_OPT_RECVBUF: &[u8] = b\"recv-buffer\";
36-
pub const NNG_OPT_SENDBUF: &[u8] = b\"send-buffer\";
37-
pub const NNG_OPT_RECVFD: &[u8] = b\"recv-fd\";
38-
pub const NNG_OPT_SENDFD: &[u8] = b\"send-fd\";
39-
pub const NNG_OPT_RECVTIMEO: &[u8] = b\"recv-timeout\";
40-
pub const NNG_OPT_SENDTIMEO: &[u8] = b\"send-timeout\";
41-
pub const NNG_OPT_LOCADDR: &[u8] = b\"local-address\";
42-
pub const NNG_OPT_REMADDR: &[u8] = b\"remote-address\";
43-
pub const NNG_OPT_URL: &[u8] = b\"url\";
44-
pub const NNG_OPT_MAXTTL: &[u8] = b\"ttl-max\";
45-
pub const NNG_OPT_RECVMAXSZ: &[u8] = b\"recv-size-max\";
46-
pub const NNG_OPT_RECONNMINT: &[u8] = b\"reconnect-time-min\";
47-
pub const NNG_OPT_RECONNMAXT: &[u8] = b\"reconnect-time-max\";
48-
pub const NNG_OPT_PEER_GID: &[u8] = b\"ipc:peer-gid\";
49-
pub const NNG_OPT_PEER_PID: &[u8] = b\"ipc:peer-pid\";
50-
pub const NNG_OPT_PEER_UID: &[u8] = b\"ipc:peer-uid\";
51-
pub const NNG_OPT_PEER_ZONEID: &[u8] = b\"ipc:peer-zoneid\";
52-
53-
pub const NNG_OPT_SUB_SUBSCRIBE: &[u8] = b\"sub:subscribe\";
54-
pub const NNG_OPT_SUB_UNSUBSCRIBE: &[u8] = b\"sub:unsubscribe\";
55-
pub const NNG_OPT_SUB_PREFNEW: &[u8] = b\"sub:prefnew\";
56-
57-
pub const NNG_OPT_PAIR1_POLY: &[u8] = b\"pair1:polyamorous\";
58-
59-
pub const NNG_OPT_REQ_RESENDTIME: &[u8] = b\"req:resend-time\";
60-
pub const NNG_OPT_REQ_RESENDTICK: &[u8] = b\"req:resend-tick\";
61-
62-
pub const NNG_OPT_SURVEYOR_SURVEYTIME: &[u8] = b\"surveyor:survey-time\";
29+
pub const NNG_OPT_SOCKNAME: &[u8] = b\"socket-name\0\";
30+
pub const NNG_OPT_RAW: &[u8] = b\"raw\0\";
31+
pub const NNG_OPT_PROTO: &[u8] = b\"protocol\0\";
32+
pub const NNG_OPT_PROTONAME: &[u8] = b\"protocol-name\0\";
33+
pub const NNG_OPT_PEER: &[u8] = b\"peer\0\";
34+
pub const NNG_OPT_PEERNAME: &[u8] = b\"peer-name\0\";
35+
pub const NNG_OPT_RECVBUF: &[u8] = b\"recv-buffer\0\";
36+
pub const NNG_OPT_SENDBUF: &[u8] = b\"send-buffer\0\";
37+
pub const NNG_OPT_RECVFD: &[u8] = b\"recv-fd\0\";
38+
pub const NNG_OPT_SENDFD: &[u8] = b\"send-fd\0\";
39+
pub const NNG_OPT_RECVTIMEO: &[u8] = b\"recv-timeout\0\";
40+
pub const NNG_OPT_SENDTIMEO: &[u8] = b\"send-timeout\0\";
41+
pub const NNG_OPT_LOCADDR: &[u8] = b\"local-address\0\";
42+
pub const NNG_OPT_REMADDR: &[u8] = b\"remote-address\0\";
43+
pub const NNG_OPT_URL: &[u8] = b\"url\0\";
44+
pub const NNG_OPT_MAXTTL: &[u8] = b\"ttl-max\0\";
45+
pub const NNG_OPT_RECVMAXSZ: &[u8] = b\"recv-size-max\0\";
46+
pub const NNG_OPT_RECONNMINT: &[u8] = b\"reconnect-time-min\0\";
47+
pub const NNG_OPT_RECONNMAXT: &[u8] = b\"reconnect-time-max\0\";
48+
pub const NNG_OPT_PEER_GID: &[u8] = b\"ipc:peer-gid\0\";
49+
pub const NNG_OPT_PEER_PID: &[u8] = b\"ipc:peer-pid\0\";
50+
pub const NNG_OPT_PEER_UID: &[u8] = b\"ipc:peer-uid\0\";
51+
pub const NNG_OPT_PEER_ZONEID: &[u8] = b\"ipc:peer-zoneid\0\";
52+
53+
pub const NNG_OPT_SUB_SUBSCRIBE: &[u8] = b\"sub:subscribe\0\";
54+
pub const NNG_OPT_SUB_UNSUBSCRIBE: &[u8] = b\"sub:unsubscribe\0\";
55+
pub const NNG_OPT_SUB_PREFNEW: &[u8] = b\"sub:prefnew\0\";
56+
57+
pub const NNG_OPT_PAIR1_POLY: &[u8] = b\"pair1:polyamorous\0\";
58+
59+
pub const NNG_OPT_REQ_RESENDTIME: &[u8] = b\"req:resend-time\0\";
60+
pub const NNG_OPT_REQ_RESENDTICK: &[u8] = b\"req:resend-tick\0\";
61+
62+
pub const NNG_OPT_SURVEYOR_SURVEYTIME: &[u8] = b\"surveyor:survey-time\0\";
6363
6464
pub const NNG_FLAG_ALLOC: core::ffi::c_int = 1;
6565
pub const NNG_FLAG_NONBLOCK: core::ffi::c_int = 2;

src/lib.rs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,40 @@
66
#![allow(non_camel_case_types)]
77
#![allow(non_snake_case)]
88

9-
pub const NNG_OPT_SOCKNAME: &[u8] = b"socket-name";
10-
pub const NNG_OPT_RAW: &[u8] = b"raw";
11-
pub const NNG_OPT_PROTO: &[u8] = b"protocol";
12-
pub const NNG_OPT_PROTONAME: &[u8] = b"protocol-name";
13-
pub const NNG_OPT_PEER: &[u8] = b"peer";
14-
pub const NNG_OPT_PEERNAME: &[u8] = b"peer-name";
15-
pub const NNG_OPT_RECVBUF: &[u8] = b"recv-buffer";
16-
pub const NNG_OPT_SENDBUF: &[u8] = b"send-buffer";
17-
pub const NNG_OPT_RECVFD: &[u8] = b"recv-fd";
18-
pub const NNG_OPT_SENDFD: &[u8] = b"send-fd";
19-
pub const NNG_OPT_RECVTIMEO: &[u8] = b"recv-timeout";
20-
pub const NNG_OPT_SENDTIMEO: &[u8] = b"send-timeout";
21-
pub const NNG_OPT_LOCADDR: &[u8] = b"local-address";
22-
pub const NNG_OPT_REMADDR: &[u8] = b"remote-address";
23-
pub const NNG_OPT_URL: &[u8] = b"url";
24-
pub const NNG_OPT_MAXTTL: &[u8] = b"ttl-max";
25-
pub const NNG_OPT_RECVMAXSZ: &[u8] = b"recv-size-max";
26-
pub const NNG_OPT_RECONNMINT: &[u8] = b"reconnect-time-min";
27-
pub const NNG_OPT_RECONNMAXT: &[u8] = b"reconnect-time-max";
28-
pub const NNG_OPT_PEER_GID: &[u8] = b"ipc:peer-gid";
29-
pub const NNG_OPT_PEER_PID: &[u8] = b"ipc:peer-pid";
30-
pub const NNG_OPT_PEER_UID: &[u8] = b"ipc:peer-uid";
31-
pub const NNG_OPT_PEER_ZONEID: &[u8] = b"ipc:peer-zoneid";
9+
pub const NNG_OPT_SOCKNAME: &[u8] = b"socket-name\0";
10+
pub const NNG_OPT_RAW: &[u8] = b"raw\0";
11+
pub const NNG_OPT_PROTO: &[u8] = b"protocol\0";
12+
pub const NNG_OPT_PROTONAME: &[u8] = b"protocol-name\0";
13+
pub const NNG_OPT_PEER: &[u8] = b"peer\0";
14+
pub const NNG_OPT_PEERNAME: &[u8] = b"peer-name\0";
15+
pub const NNG_OPT_RECVBUF: &[u8] = b"recv-buffer\0";
16+
pub const NNG_OPT_SENDBUF: &[u8] = b"send-buffer\0";
17+
pub const NNG_OPT_RECVFD: &[u8] = b"recv-fd\0";
18+
pub const NNG_OPT_SENDFD: &[u8] = b"send-fd\0";
19+
pub const NNG_OPT_RECVTIMEO: &[u8] = b"recv-timeout\0";
20+
pub const NNG_OPT_SENDTIMEO: &[u8] = b"send-timeout\0";
21+
pub const NNG_OPT_LOCADDR: &[u8] = b"local-address\0";
22+
pub const NNG_OPT_REMADDR: &[u8] = b"remote-address\0";
23+
pub const NNG_OPT_URL: &[u8] = b"url\0";
24+
pub const NNG_OPT_MAXTTL: &[u8] = b"ttl-max\0";
25+
pub const NNG_OPT_RECVMAXSZ: &[u8] = b"recv-size-max\0";
26+
pub const NNG_OPT_RECONNMINT: &[u8] = b"reconnect-time-min\0";
27+
pub const NNG_OPT_RECONNMAXT: &[u8] = b"reconnect-time-max\0";
28+
pub const NNG_OPT_PEER_GID: &[u8] = b"ipc:peer-gid\0";
29+
pub const NNG_OPT_PEER_PID: &[u8] = b"ipc:peer-pid\0";
30+
pub const NNG_OPT_PEER_UID: &[u8] = b"ipc:peer-uid\0";
31+
pub const NNG_OPT_PEER_ZONEID: &[u8] = b"ipc:peer-zoneid\0";
3232

33-
pub const NNG_OPT_SUB_SUBSCRIBE: &[u8] = b"sub:subscribe";
34-
pub const NNG_OPT_SUB_UNSUBSCRIBE: &[u8] = b"sub:unsubscribe";
35-
pub const NNG_OPT_SUB_PREFNEW: &[u8] = b"sub:prefnew";
33+
pub const NNG_OPT_SUB_SUBSCRIBE: &[u8] = b"sub:subscribe\0";
34+
pub const NNG_OPT_SUB_UNSUBSCRIBE: &[u8] = b"sub:unsubscribe\0";
35+
pub const NNG_OPT_SUB_PREFNEW: &[u8] = b"sub:prefnew\0";
3636

37-
pub const NNG_OPT_PAIR1_POLY: &[u8] = b"pair1:polyamorous";
37+
pub const NNG_OPT_PAIR1_POLY: &[u8] = b"pair1:polyamorous\0";
3838

39-
pub const NNG_OPT_REQ_RESENDTIME: &[u8] = b"req:resend-time";
40-
pub const NNG_OPT_REQ_RESENDTICK: &[u8] = b"req:resend-tick";
39+
pub const NNG_OPT_REQ_RESENDTIME: &[u8] = b"req:resend-time\0";
40+
pub const NNG_OPT_REQ_RESENDTICK: &[u8] = b"req:resend-tick\0";
4141

42-
pub const NNG_OPT_SURVEYOR_SURVEYTIME: &[u8] = b"surveyor:survey-time";
42+
pub const NNG_OPT_SURVEYOR_SURVEYTIME: &[u8] = b"surveyor:survey-time\0";
4343

4444
pub const NNG_FLAG_ALLOC: core::ffi::c_int = 1;
4545
pub const NNG_FLAG_NONBLOCK: core::ffi::c_int = 2;

0 commit comments

Comments
 (0)