The 'p' (Pascal string) pack code acts unreasonably when the string size
and count exceed 255.  Changed to preserve as much of the string as
possible (instead of count%256 characters).
diff --git a/Modules/structmodule.c b/Modules/structmodule.c
index 46aa75b..61436f9 100644
--- a/Modules/structmodule.c
+++ b/Modules/structmodule.c
@@ -1360,6 +1360,8 @@
 				if (n < num)
 					/* no real need, just to be nice */
 					memset(res+1+n, '\0', num-n);
+				if (n > 255)
+					n = 255;
 				*res++ = n; /* store the length byte */
 				res += num;
 				break;