Prevent crash if logbook "global<xxx>" is accessed and a logbook "global<xxx>" is defined in config file

SVN revision: 1748
This commit is contained in:
2006-11-08 15:52:18 +00:00
parent e93b0091cf
commit 4a6fae7528
+6 -2
View File
@@ -2645,9 +2645,13 @@ int is_logbook(char *logbook)
{
char str[256];
if (strieq(logbook, "global"))
return 0;
/* check for 'global group' or 'global_xxx' */
strlcpy(str, logbook, sizeof(str));
str[6] = 0;
return !strieq(str, "global");
str[7] = 0;
return !strieq(str, "global ");
}
/*-------------------------------------------------------------------*/