diff options
author | Timo Sirainen <cras@irssi.org> | 2002-03-14 01:54:05 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-03-14 01:54:05 +0000 |
commit | 265ecbc74d2cf2cd0720757cdef88e68bd6f28a9 (patch) | |
tree | 4677b8b0bdc60596e9cce1effc64f6b7cab37d11 /src/core | |
parent | 7d88170b0b80d57d729a1ea429b55d957197fa8e (diff) | |
download | irssi-265ecbc74d2cf2cd0720757cdef88e68bd6f28a9.zip |
Don't crash if there's no prefixes (botti doesn't) when loading module.
Patch by aldem-irssi@aldem.net
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2607 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/modules-load.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/core/modules-load.c b/src/core/modules-load.c index e7e78091..69bdecdf 100644 --- a/src/core/modules-load.c +++ b/src/core/modules-load.c @@ -64,13 +64,16 @@ static char *module_get_root(const char *name, char **prefixes) int len; /* skip any of the prefixes.. */ - while (*prefixes != NULL) { - len = strlen(*prefixes); - if (strncmp(name, *prefixes, len) == 0 && name[len] == '_') { - name += len+1; - break; + if (prefixes != NULL) { + while (*prefixes != NULL) { + len = strlen(*prefixes); + if (strncmp(name, *prefixes, len) == 0 && + name[len] == '_') { + name += len+1; + break; + } + prefixes++; } - prefixes++; } /* skip the _core part */ |