summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Kalowsky <daniel.kalowsky@intel.com>2015-10-14 13:27:07 -0700
committerAnas Nashif <anas.nashif@intel.com>2016-02-05 20:24:31 -0500
commit7cfc70371146fd2efa31c92f78cafed0d50340d9 (patch)
treea9a6ebb006163805fb049dba2ee6d7d9fae418ad /lib
parent4518f747afbf6bc0ff6b59faf6beee099437c46a (diff)
checkpatch: error - trailing statements
Change-Id: I461134536da0288261b90f605a904ab3ea466340 Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/minimal/source/stdlib/atoi.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/libc/minimal/source/stdlib/atoi.c b/lib/libc/minimal/source/stdlib/atoi.c
index 863cbe016..a76b8a698 100644
--- a/lib/libc/minimal/source/stdlib/atoi.c
+++ b/lib/libc/minimal/source/stdlib/atoi.c
@@ -29,13 +29,18 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
int atoi(const char *s)
{
int n=0, neg=0;
- while (isspace(*s)) s++;
+ while (isspace(*s)) {
+ s++;
+ }
switch (*s) {
- case '-': neg=1;
- case '+': s++;
+ case '-':
+ neg=1;
+ case '+':
+ s++;
}
/* Compute n as a negative number to avoid overflow on INT_MIN */
- while (isdigit(*s))
+ while (isdigit(*s)) {
n = 10*n - (*s++ - '0');
+ }
return neg ? n : -n;
}