From 95fdbc14ffaff5f5dd8fffadc4264f41fc621085 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 26 Jul 2018 17:14:40 +0200 Subject: 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 --- utils/osmo-sim-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'utils') 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); } -- cgit v1.2.3