summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/main.go b/main.go
index ce1d142..53e7359 100644
--- a/main.go
+++ b/main.go
@@ -459,7 +459,7 @@ func processTemplate(content string, locale *Locale) string {
i := 0
for i < len(content) {
// Check for include directive: <!-- %include.
- if i+14 < len(content) && content[i:i+14] == "<!-- %include." {
+ if i+14 <= len(content) && content[i:i+14] == "<!-- %include." {
// Find end of include directive: % -->
endPos := strings.Index(content[i+14:], "% -->")
if endPos != -1 {
@@ -475,13 +475,13 @@ func processTemplate(content string, locale *Locale) string {
result.WriteString(processed)
}
// Skip past the include directive
- i = endPos + 4 // Skip "% -->"
+ i = endPos + 5 // Skip "% -->" (5 characters)
continue
}
}
// Check for locale variable: %locale.
- if i+8 < len(content) && content[i:i+8] == "%locale." {
+ if i+8 <= len(content) && content[i:i+8] == "%locale." {
// Find end of locale variable: %
endPos := strings.IndexByte(content[i+8:], '%')
if endPos != -1 {