summaryrefslogtreecommitdiff
path: root/tools/aapt/Resource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/aapt/Resource.cpp')
-rw-r--r--tools/aapt/Resource.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp
index 0c0e639acf9e..b5590026d9d2 100644
--- a/tools/aapt/Resource.cpp
+++ b/tools/aapt/Resource.cpp
@@ -547,7 +547,7 @@ static int validateAttr(const String8& path, const ResTable& table,
String8(parser.getElementName(&len)).string(), attr);
return ATTR_LEADING_SPACES;
}
- if (str[len-1] == ' ') {
+ if (len != 0 && str[len-1] == ' ') {
fprintf(stderr, "%s:%d: Tag <%s> attribute %s can not end with a space.\n",
path.string(), parser.getLineNumber(),
String8(parser.getElementName(&len)).string(), attr);