Skip to content

Commit 943cfd8

Browse files
committed
Add unsafe block for pop_terminator
1 parent f9616cf commit 943cfd8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/c_string.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ impl<const N: usize> CString<N> {
223223
&mut self,
224224
additional: &[u8],
225225
) -> Result<(), CapacityError> {
226-
self.pop_terminator();
226+
// SAFETY: A caller is responsible for adding a nul terminator back to the inner buffer.
227+
unsafe { self.pop_terminator() }
227228

228229
self.inner.extend_from_slice(additional)
229230
}

0 commit comments

Comments
 (0)