diff options
Diffstat (limited to 'dmenu.c')
-rw-r--r-- | dmenu.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -31,7 +31,7 @@ static void grabkeyboard(void); | |||
31 | static void insert(const char *str, ssize_t n); | 31 | static void insert(const char *str, ssize_t n); |
32 | static void keypress(XKeyEvent *ev); | 32 | static void keypress(XKeyEvent *ev); |
33 | static void match(Bool sub); | 33 | static void match(Bool sub); |
34 | static size_t nextrune(int incr); | 34 | static size_t nextrune(int inc); |
35 | static void paste(void); | 35 | static void paste(void); |
36 | static void readstdin(void); | 36 | static void readstdin(void); |
37 | static void run(void); | 37 | static void run(void); |
@@ -426,10 +426,10 @@ match(Bool sub) { | |||
426 | } | 426 | } |
427 | 427 | ||
428 | size_t | 428 | size_t |
429 | nextrune(int incr) { | 429 | nextrune(int inc) { |
430 | size_t n, len = strlen(text); | 430 | ssize_t n; |
431 | 431 | ||
432 | for(n = cursor + incr; n < len && (text[n] & 0xc0) == 0x80; n += incr); | 432 | for(n = cursor + inc; n + inc >= 0 && (text[n] & 0xc0) == 0x80; n += inc); |
433 | return n; | 433 | return n; |
434 | } | 434 | } |
435 | 435 | ||