diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-07-26 17:14:40 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-07-27 18:15:44 +0000 |
commit | 95fdbc14ffaff5f5dd8fffadc4264f41fc621085 (patch) | |
tree | fa22571c498d57cdf3ce41c4f8999d7d3f5b54e7 /utils | |
parent | 1cea7b5a97a0069eb409bf86e4a67913b687c3bd (diff) |
cosmetic: osmo-sim-test.c: use memcpy instead of strncpy
gcc 8.1.0 complains that the terminating \0 is not copied by strncpy, while
this code intends to do exactly that. Use memcpy instead.
Change-Id: I8d66fa22502c04d11ae153b9856d7e54f3492dd6
Diffstat (limited to 'utils')
-rw-r--r-- | utils/osmo-sim-test.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/osmo-sim-test.c b/utils/osmo-sim-test.c index ea241206..5588294a 100644 --- a/utils/osmo-sim-test.c +++ b/utils/osmo-sim-test.c @@ -74,7 +74,8 @@ static int verify_pin(struct osim_chan_hdl *st, uint8_t pin_nr, char *pin) msg = osim_new_apdumsg(0x00, 0x20, 0x00, pin_nr, 8, 0); pindst = (char *) msgb_put(msg, 8); memset(pindst, 0xFF, 8); - strncpy(pindst, pin, strlen(pin)); + /* Do not copy the terminating \0 */ + memcpy(pindst, pin, strlen(pin)); return osim_transceive_apdu(st, msg); } |