commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 06/15: console-client: assert precondition


From: Samuel Thibault
Subject: [hurd] 06/15: console-client: assert precondition
Date: Sun, 05 Jul 2015 00:41:59 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit ffea85471c65fd7758e159207ae7f7a089106644
Author: Diego Nieto Cid <address@hidden>
Date:   Thu Jun 4 22:58:09 2015 -0300

    console-client: assert precondition
    
    * console-client/xkb/kstoucs.c (find_ucs): assert precondition.
---
 console-client/xkb/kstoucs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/console-client/xkb/kstoucs.c b/console-client/xkb/kstoucs.c
index 8471e94..fb62445 100644
--- a/console-client/xkb/kstoucs.c
+++ b/console-client/xkb/kstoucs.c
@@ -1,3 +1,5 @@
+#include <assert.h>
+
 struct ksmap {
   int keysym;
   unsigned int ucs;
@@ -11,6 +13,8 @@ find_ucs (int keysym, struct ksmap *first, struct ksmap *last)
 {
   struct ksmap *middle = first + (last - first) / 2;
 
+  assert (first <= last);
+
   if (middle->keysym == keysym)
     return middle->ucs; /* base case: needle found. */
   else if (first == last               /* empty search space */

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]