From 0d857ec599c75d326464860bb413d4c777347053 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sun, 23 Apr 2017 13:25:49 +1000 Subject: [PATCH] debugging --- doors.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doors.c b/doors.c index d9b3802..012b0cd 100644 --- a/doors.c +++ b/doors.c @@ -189,6 +189,7 @@ void runexternal(struct user_record *user, char *cmd, int stdio, char *argv[], c char *ptr2p; size_t ouc; size_t inc; + size_t sz; timeoutpaused = 1; @@ -360,7 +361,10 @@ void runexternal(struct user_record *user, char *cmd, int stdio, char *argv[], c inc = g; ouc = g * 2; - iconv(ic, &ptr1, &inc, &ptr2, &ouc); + sz = iconv(ic, &ptr1, &inc, &ptr2, &ouc); + if (sz == -1) { + perror("Iconv"); + } write(door_out, ptr2p, ptr2 - ptr2p); free(ptr2p);