aboutsummaryrefslogtreecommitdiffstats
path: root/libterminput_marshal_text__.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2025-02-21 16:33:10 +0100
committerMattias Andrée <m@maandree.se>2025-02-21 16:33:10 +0100
commit2bcfca7a468c3350ce9a28a9a18dce623a7645ee (patch)
tree5d7b8a1c0508fe49661be405416c3b421cad2925 /libterminput_marshal_text__.c
parentUpdate readme (diff)
downloadlibterminput-2bcfca7a468c3350ce9a28a9a18dce623a7645ee.tar.gz
libterminput-2bcfca7a468c3350ce9a28a9a18dce623a7645ee.tar.bz2
libterminput-2bcfca7a468c3350ce9a28a9a18dce623a7645ee.tar.xz
Some fixes and testsHEAD1.1master
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libterminput_marshal_text__.c')
-rw-r--r--libterminput_marshal_text__.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libterminput_marshal_text__.c b/libterminput_marshal_text__.c
index 264ec04..5fa1325 100644
--- a/libterminput_marshal_text__.c
+++ b/libterminput_marshal_text__.c
@@ -3,8 +3,10 @@
int
-libterminput_marshal_text__(struct libterminput_marshaller *how, const struct libterminput_text *what) /* TODO test */
+libterminput_marshal_text__(struct libterminput_marshaller *how, const struct libterminput_text *what)
{
+ if (what->nbytes > sizeof(what->bytes))
+ abort();
if (how->store(how, &what->nbytes, sizeof(what->nbytes)) ||
how->store(how, what->bytes, what->nbytes))
return -1;