mirror of git://git.sysmocom.de/ofono
sim-auth: Use memcpy instead of strncpy
The code is not really copying strings but 2 or 3 character sof the MNC. Make this clearer.
This commit is contained in:
parent
d3625f8e6f
commit
614ffb0761
|
@ -659,10 +659,10 @@ static char *build_nai(const char *imsi)
|
|||
strncpy(mcc, imsi, 3);
|
||||
|
||||
if (strlen(imsi) == 16) {
|
||||
strncpy(mnc, imsi + 3, 3);
|
||||
memcpy(mnc, imsi + 3, 3);
|
||||
} else {
|
||||
mnc[0] = '0';
|
||||
strncpy(mnc + 1, imsi + 3, 2);
|
||||
memcpy(mnc + 1, imsi + 3, 2);
|
||||
}
|
||||
|
||||
nai = g_strdup_printf("%s@ims.mnc%.3s.mcc%.3s.3gppnetwork.org",
|
||||
|
|
Loading…
Reference in New Issue