From 56392e5c2e84a0b80edafdbbd5a522a611f0ea2b Mon Sep 17 00:00:00 2001 From: Sathish Narasimman Date: Thu, 3 Nov 2016 20:12:56 +0530 Subject: [PATCH] Bluetooth: Fix initialization of variable Initialize the variable to zero before computing. Change-Id: Iccdf77a085667728dbb68779f001c8d940a7a89d Signed-off-by: Sathish Narasimman --- subsys/bluetooth/host/at.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subsys/bluetooth/host/at.c b/subsys/bluetooth/host/at.c index 3f022cc190d..dd225c16e99 100644 --- a/subsys/bluetooth/host/at.c +++ b/subsys/bluetooth/host/at.c @@ -50,6 +50,8 @@ const char *skip_whitespace(const char *buf) int at_get_number(const char *buf, uint32_t *val) { + *val = 0; + for (buf = skip_whitespace(buf); isdigit(*buf); buf++) { *val = *val * 10 + *buf - '0'; }