From a4424abe14d908b8e08ffbabc508cc31448923bc Mon Sep 17 00:00:00 2001 From: Johan Redestig Date: Tue, 9 Nov 2010 14:13:31 +0100 Subject: [PATCH] Make AaptGroupEntry::getMncName accept mnc00 MNC 00 is a valid network code and is used by some operators, see http://en.wikipedia.org/wiki/Mobile_Network_Code. Remove the test that checks if atoi returns zero. The string is validated to contain only numbers already. Also discussed here: https://code.google.com/p/android/issues/detail?id=3657 Change-Id: I3220d7980abe4067c9e7aa4cbc10b5fd0b8c9ea7 --- AaptAssets.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/AaptAssets.cpp b/AaptAssets.cpp index e4f447e..2b2ec7b 100644 --- a/AaptAssets.cpp +++ b/AaptAssets.cpp @@ -685,13 +685,11 @@ bool AaptGroupEntry::getMncName(const char* name, if (*c != 0) return false; if (c-val == 0 || c-val > 3) return false; - int d = atoi(val); - if (d != 0) { - if (out) out->mnc = d; - return true; + if (out) { + out->mnc = atoi(val); } - return false; + return true; } /* -- 2.47.2