Minor changes
Fork of CNManager by
Revision 2:df290d9a76d4, committed 2016-11-13
- Comitter:
- amq
- Date:
- Sun Nov 13 00:04:01 2016 +0000
- Parent:
- 1:29ad1d1ac1f9
- Commit message:
- strlen
Changed in this revision
CNData.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 29ad1d1ac1f9 -r df290d9a76d4 CNData.cpp --- a/CNData.cpp Thu Jan 21 14:00:25 2016 +0000 +++ b/CNData.cpp Sun Nov 13 00:04:01 2016 +0000 @@ -30,9 +30,9 @@ dataIsEnable = false; tmDataPullStatus.setExpireTimeout(TIMEOUT_CHECK_STATUS_DATA_CONNECITION); tmDataRetry.setExpireTimeout(TIMEOUT_RETRY_DATA_CONNECTION); - memset(dapn, 0, sizeof(dapn)); - memset(dusername, 0, sizeof(dusername)); - memset(dpassword, 0, sizeof(dpassword)); + memset(dapn, 0, strlen(dapn)); + memset(dusername, 0, strlen(dusername)); + memset(dpassword, 0, strlen(dpassword)); auth = MDMParser::AUTH_DETECT; } @@ -52,11 +52,11 @@ { TRACE("%s enter \r\n", __FUNCTION__); if (apn) - strncpy(dapn, apn, sizeof(apn)); + strncpy(dapn, apn, strlen(apn)); if (username) - strncpy(dusername, username, sizeof(username)); + strncpy(dusername, username, strlen(username)); if (password) - strncpy(dpassword, password, sizeof(password)); + strncpy(dpassword, password, strlen(password)); } CNResp cnDataLoop(CNLib* const lib, RegStatus regStatus,DataConnStatus* const dataStatus)