Index: tests/io/.expect/manipulatorsInput.arm64.txt
===================================================================
--- tests/io/.expect/manipulatorsInput.arm64.txt	(revision f54e6ec8f379b4f45d0b911f99fb6ac3c6e9c9c5)
+++ tests/io/.expect/manipulatorsInput.arm64.txt	(revision 2fa0237f52bd8db42015c83dee0d38191a902db4)
@@ -1,2 +1,5 @@
+pre1 "123456", canary ok
+pre2a "1234567", exception occurred, canary ok
+pre2b "89", canary ok
 1 yyyyyyyyyyyyyyyyyyyy
 2 abcxxx
Index: tests/io/.expect/manipulatorsInput.x64.txt
===================================================================
--- tests/io/.expect/manipulatorsInput.x64.txt	(revision f54e6ec8f379b4f45d0b911f99fb6ac3c6e9c9c5)
+++ tests/io/.expect/manipulatorsInput.x64.txt	(revision 2fa0237f52bd8db42015c83dee0d38191a902db4)
@@ -1,2 +1,5 @@
+pre1 "123456", canary ok
+pre2a "1234567", exception occurred, canary ok
+pre2b "89", canary ok
 1 yyyyyyyyyyyyyyyyyyyy
 2 abcxxx
Index: tests/io/.expect/manipulatorsInput.x86.txt
===================================================================
--- tests/io/.expect/manipulatorsInput.x86.txt	(revision f54e6ec8f379b4f45d0b911f99fb6ac3c6e9c9c5)
+++ tests/io/.expect/manipulatorsInput.x86.txt	(revision 2fa0237f52bd8db42015c83dee0d38191a902db4)
@@ -1,2 +1,5 @@
+pre1 "123456", canary ok
+pre2a "1234567", exception occurred, canary ok
+pre2b "89", canary ok
 1 yyyyyyyyyyyyyyyyyyyy
 2 abcxxx
Index: tests/io/.in/manipulatorsInput.txt
===================================================================
--- tests/io/.in/manipulatorsInput.txt	(revision f54e6ec8f379b4f45d0b911f99fb6ac3c6e9c9c5)
+++ tests/io/.in/manipulatorsInput.txt	(revision 2fa0237f52bd8db42015c83dee0d38191a902db4)
@@ -1,2 +1,4 @@
+123456
+123456789
 abc 
 abc 
Index: tests/io/manipulatorsInput.cfa
===================================================================
--- tests/io/manipulatorsInput.cfa	(revision f54e6ec8f379b4f45d0b911f99fb6ac3c6e9c9c5)
+++ tests/io/manipulatorsInput.cfa	(revision 2fa0237f52bd8db42015c83dee0d38191a902db4)
@@ -15,4 +15,39 @@
 
 int main() {
+	{
+		// Upfront checks to ensure buffer safety.  Once these pass, the simpler `wdi(sizeof(s),s)`
+		// usage, as in the scanf alignment cases below, is justified.
+		struct {
+			char buf[8];
+			char canary;
+		} data;
+		static_assert( sizeof(data.buf) == 8 );
+		static_assert( &data.buf[8] == &data.canary );  // canary comes right after buf
+
+		void rep(const char* casename) {
+			data.canary = 42;
+			bool caught = false;
+			try {
+				sin | wdi( sizeof(data.buf), data.buf );
+			} catch (cstring_length*) {
+				caught = true;
+			}
+			printf( "%s \"%s\"", casename, data.buf );
+			if ( caught ) {
+				printf(", exception occurred");
+			}
+			if ( data.canary == 42 ) {
+				printf(", canary ok");
+			} else {
+				printf(", canary overwritten to %d", data.canary);
+			}
+			printf("\n");
+		}
+
+		rep("pre1");
+		rep("pre2a");
+		rep("pre2b");
+		scanf("\n");  // next test does not start with %s so does not tolerate leading whitespace
+	}
 	{
 		char s[] = "yyyyyyyyyyyyyyyyyyyy";
