summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-12-29 19:50:03 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-12-29 19:50:03 +0100
commit6fa066836fa6fd4164244337d1facee369a074fd (patch)
tree76f32e43c36ae750a0d8f9e52586264d836b17f3
parent8fc4ebed2b2fd094f09f329fd284b4ce916271c7 (diff)
downloadhardware_ril_samsung-ril-6fa066836fa6fd4164244337d1facee369a074fd.zip
hardware_ril_samsung-ril-6fa066836fa6fd4164244337d1facee369a074fd.tar.gz
hardware_ril_samsung-ril-6fa066836fa6fd4164244337d1facee369a074fd.tar.bz2
network: Account for three-digit MNC codes
Makes the OPERATOR request work in countries that use three-digit MNC codes. Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
-rw-r--r--network.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/network.c b/network.c
index ae40dbe..9295ea7 100644
--- a/network.c
+++ b/network.c
@@ -285,7 +285,10 @@ int ipc2ril_net_operator(char *data, size_t size, char **plmn,
*operator_long = NULL;
*operator_short = NULL;
- rc = sscanf((char *) &buffer, "%3u%2u", &mcc, &mnc);
+ if (buffer[5] == '\0')
+ rc = sscanf((char *) &buffer, "%3u%2u", &mcc, &mnc);
+ else
+ rc = sscanf((char *) &buffer, "%3u%3u", &mcc, &mnc);
if (rc < 2)
goto error;