diff options
author | trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-12-27 03:22:46 +0000 |
---|---|---|
committer | trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-12-27 03:22:46 +0000 |
commit | d0b1978f623a3b1b9401f69142ea2e2032758c2f (patch) | |
tree | c20f14924eb6dbcdacc164309c8897716c9c7c52 /src/config.c | |
parent | 0607b8c2b2a0510207a73320f4532844863ec9a0 (diff) |
BUILD : 1.7.6 (505) BUGS : N/A NOTES : Some documentation updated, fixed compiler errors with ptlink, and fixed a segfault with some options when set with just quotes
git-svn-id: svn://svn.anope.org/anope/trunk@505 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@359 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/config.c b/src/config.c index 87c959a59..11a772832 100644 --- a/src/config.c +++ b/src/config.c @@ -1189,13 +1189,20 @@ int read_config(int reload) s = strtok(ServicesRoot, " "); do { - RootNumber++; - ServicesRoots = - realloc(ServicesRoots, sizeof(char *) * RootNumber); - ServicesRoots[RootNumber - 1] = sstrdup(s); + if (s) { + RootNumber++; + ServicesRoots = + realloc(ServicesRoots, sizeof(char *) * RootNumber); + ServicesRoots[RootNumber - 1] = sstrdup(s); + } } while ((s = strtok(NULL, " "))); } + if (!RootNumber) { + error(0, "No ServicesRoot defined"); + retval = 0; + } + /* Ulines */ if (UlineServers) { @@ -1203,9 +1210,11 @@ int read_config(int reload) s = strtok(UlineServers, " "); do { - NumUlines++; - Ulines = realloc(Ulines, sizeof(char *) * NumUlines); - Ulines[NumUlines - 1] = sstrdup(s); + if (s) { + NumUlines++; + Ulines = realloc(Ulines, sizeof(char *) * NumUlines); + Ulines[NumUlines - 1] = sstrdup(s); + } } while ((s = strtok(NULL, " "))); } |