projects
/
monky
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
apcupsd and iostats work on FreeBSD
[monky]
/
src
/
template.c
diff --git
a/src/template.c
b/src/template.c
index
4cbf21d
..
a4351fd
100644
(file)
--- a/
src/template.c
+++ b/
src/template.c
@@
-10,7
+10,7
@@
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
- * Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
+ * Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
* (see AUTHORS)
* All rights reserved.
*
@@
-203,7
+203,7
@@
char *find_and_replace_templates(const char *inbuf)
if (!(*p))
break;
if (!(*p))
break;
- if (strncmp(p, "$template", 9) && strncmp(p, "${template", 10)) {
+ if (strncmp(p, "$template", strlen("$template")) && strncmp(p, "${template", strlen("${template"))) {
*(o++) = *(p++);
continue;
}
*(o++) = *(p++);
continue;
}
@@
-235,7
+235,8
@@
char *find_and_replace_templates(const char *inbuf)
}
} else {
templ = p + 1;
}
} else {
templ = p + 1;
- while (*p && !isspace(*p))
+ p += strlen("$template");
+ while (*p && isdigit(*p))
p++;
args = NULL;
}
p++;
args = NULL;
}