diff options
author | Jeff Hatch <jhatch@multitech.com> | 2020-07-28 15:54:53 -0500 |
---|---|---|
committer | Jeff Hatch <jhatch@multitech.com> | 2020-07-28 15:54:53 -0500 |
commit | 86a736c52268c0cec3d7c9e14a007ae11e4907d7 (patch) | |
tree | 558563e0bbbb802561eb54b88393535f9d75b078 | |
parent | 5246748a8e5119dbca894e1eec3054a33acdc1c4 (diff) | |
parent | 06bc056e71ce7056dd59c0004d8a9a26753c3f85 (diff) | |
download | sms-utils-86a736c52268c0cec3d7c9e14a007ae11e4907d7.tar.gz sms-utils-86a736c52268c0cec3d7c9e14a007ae11e4907d7.tar.bz2 sms-utils-86a736c52268c0cec3d7c9e14a007ae11e4907d7.zip |
Merge branch 'vp/MTX_3534_fix_crash' into 'master'
MTX-3534 Fix crashes on 64-bit platforms
See merge request !12
-rw-r--r-- | src/atcmd.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/atcmd.c b/src/atcmd.c index 1fd3452..90d2774 100644 --- a/src/atcmd.c +++ b/src/atcmd.c @@ -1307,6 +1307,7 @@ int atcmd_plus_iccid_read(int fd) char *save; char *token; int tmp; + char *tmp_buf; char* command; if (is_telit_model()) { @@ -1340,17 +1341,18 @@ int atcmd_plus_iccid_read(int fd) if (!token) { log_debug("atcmd_value_tok model"); return -1; - } else + } else { log_debug("token is %s",token); - tmp = strrchr(token,' '); - if(tmp){ - token = ++tmp; + } + tmp_buf = strrchr(token,' '); + if (tmp_buf) { + token = ++tmp_buf; log_debug("Found blank, incrementing tmp"); } else { - tmp = strrchr(token,'\t'); + tmp_buf = strrchr(token,'\t'); log_debug("Found tab, incrementing tmp"); - if(tmp) - token = ++tmp; + if(tmp_buf) + token = ++tmp_buf; } log_debug("token[0]=%2.2x token[1]=%2.2x",token[0],token[1]); strncpy(Global.core.iccid, token, ICCID_LEN); |