gprs subscr: fix: intended strcmp(), but is strcpy()
The code checked 'if (strcpy(..) != 0)' which is always true and thus always copied twice -- luckily we want to copy anyway and so this is not an actual functional failure. We could correct to strcmp, but instead of iterating to compare, we might as well copy right away. Change-Id: I0ea035bd478f7022ed65e9e84d8aaf5e423309b7
This commit is contained in:
parent
3d07aef800
commit
04db87a89f
|
@ -778,11 +778,9 @@ struct gsm_subscriber *gprs_subscr_get_or_create_by_mmctx(struct sgsn_mm_ctx *mm
|
|||
subscr->flags &= ~GPRS_SUBSCRIBER_ENABLE_PURGE;
|
||||
}
|
||||
|
||||
if (strcpy(subscr->equipment.imei, mmctx->imei) != 0) {
|
||||
strncpy(subscr->equipment.imei, mmctx->imei,
|
||||
sizeof(subscr->equipment.imei)-1);
|
||||
subscr->equipment.imei[sizeof(subscr->equipment.imei)-1] = 0;
|
||||
}
|
||||
strncpy(subscr->equipment.imei, mmctx->imei,
|
||||
sizeof(subscr->equipment.imei)-1);
|
||||
subscr->equipment.imei[sizeof(subscr->equipment.imei)-1] = 0;
|
||||
|
||||
if (subscr->lac != mmctx->ra.lac)
|
||||
subscr->lac = mmctx->ra.lac;
|
||||
|
|
Loading…
Reference in New Issue