diff options
author | Justus Winter <justus@gnupg.org> | 2017-06-19 21:20:57 +0200 |
---|---|---|
committer | Justus Winter <justus@gnupg.org> | 2017-08-05 18:42:22 +0200 |
commit | 835b293d35a209d38047126443d41fa7090daa4c (patch) | |
tree | 5bf956895e6030f91cd618fb191b2151f6d25423 /console-client/pc-kbd.c | |
parent | dc0b5a43224999223a246870912b0f292b1980e9 (diff) | |
download | hurd-835b293d35a209d38047126443d41fa7090daa4c.tar.gz hurd-835b293d35a209d38047126443d41fa7090daa4c.tar.bz2 hurd-835b293d35a209d38047126443d41fa7090daa4c.zip |
Use our own variant of 'assert' and 'assert_perror'.
Our variants print stack traces on failures. This will make locating
errors much easier.
Diffstat (limited to 'console-client/pc-kbd.c')
-rw-r--r-- | console-client/pc-kbd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/console-client/pc-kbd.c b/console-client/pc-kbd.c index 2fc7608f..85f3a5cd 100644 --- a/console-client/pc-kbd.c +++ b/console-client/pc-kbd.c @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ #include <errno.h> -#include <assert.h> +#include <assert-backtrace.h> #include <string.h> #include <iconv.h> #include <sys/mman.h> @@ -1084,12 +1084,12 @@ input_loop (void *unused) if (!sc_to_kc[sc][modifier][0]) { /* Special meaning, emit NUL. */ - assert (size < 100); + assert_backtrace (size < 100); buf[size++] = '\0'; } else { - assert (size + assert_backtrace (size < 101 - strlen(sc_to_kc[sc][modifier])); strcpy (&buf[size], sc_to_kc[sc][modifier]); size += strlen (sc_to_kc[sc][modifier]); @@ -1162,7 +1162,7 @@ input_loop (void *unused) { if (modifier >= 0 && sc_x1_to_kc[sc][modifier]) { - assert (size < 101 - strlen(sc_x1_to_kc[sc][modifier])); + assert_backtrace (size < 101 - strlen(sc_x1_to_kc[sc][modifier])); strcpy (&buf[size], sc_x1_to_kc[sc][modifier]); size += strlen (sc_x1_to_kc[sc][modifier]); } |