comparison libnnchat.c @ 108:f323b137ca08

Tab-completion now works with cycling, but bugs with names that have whitespaces.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 23 Oct 2010 02:01:00 +0300
parents c587a99e2096
children 741e45592522
comparison
equal deleted inserted replaced
107:8037a3a7e491 108:f323b137ca08
655 655
656 nn_user_t *nn_user_match(const nn_userhash_t *list, const char *pattern, const char *current) 656 nn_user_t *nn_user_match(const nn_userhash_t *list, const char *pattern, const char *current)
657 { 657 {
658 uint8_t hash; 658 uint8_t hash;
659 659
660 if (list == NULL) return NULL; 660 if (list == NULL || pattern == NULL) return NULL;
661 661
662 hash = nn_hash_user(pattern); 662 hash = nn_hash_user(pattern);
663 if (list->buckets[hash] != NULL) { 663 if (list->buckets[hash] != NULL) {
664 nn_user_t *curr = list->buckets[hash]; 664 nn_user_t *curr = list->buckets[hash];
665 size_t len = strlen(pattern); 665 size_t len = strlen(pattern);