diff options
author | Harshit Sharma <harshitsharmajs@gmail.com> | 2020-05-22 13:07:17 +0530 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-05-28 09:33:55 +0000 |
commit | 8f2737476805ee9629af1ad16646e6258825a24b (patch) | |
tree | f9c47c50fe0bb6d62f2dc85af73a38d71e42e664 /payloads | |
parent | c43a09b1186c36f72f6edcac37ce17cefd34f241 (diff) |
payloads/libpayload/libc: Do cosmetic fixes
Make the code follow the coding style.
Signed-off-by: Harshit Sharma <harshitsharmajs@gmail.com>
Change-Id: I4ca168c4aedddef51103b270f105feab93739ecc
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41649
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'payloads')
-rw-r--r-- | payloads/libpayload/libc/string.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/payloads/libpayload/libc/string.c b/payloads/libpayload/libc/string.c index b1d89d3fcc..c05a012f51 100644 --- a/payloads/libpayload/libc/string.c +++ b/payloads/libpayload/libc/string.c @@ -361,7 +361,7 @@ char *strsep(char **stringp, const char *delim) token = walk = *stringp; /* Walk, search for delimiters */ - while(*walk && !strchr(delim, *walk)) + while (*walk && !strchr(delim, *walk)) walk++; if (*walk) { @@ -424,7 +424,7 @@ long long int strtoll(const char *orig_ptr, char **endptr, int base) /* Purge whitespace */ - for( ; *ptr && isspace(*ptr); ptr++); + for ( ; *ptr && isspace(*ptr); ptr++); if (ptr[0] == '-') { is_negative = 1; @@ -478,7 +478,7 @@ unsigned long long int strtoull(const char *ptr, char **endptr, int base) /* Purge whitespace */ - for( ; *ptr && isspace(*ptr); ptr++); + for ( ; *ptr && isspace(*ptr); ptr++); if (!*ptr) return 0; @@ -491,9 +491,9 @@ unsigned long long int strtoull(const char *ptr, char **endptr, int base) else if (ptr[0] == '0') { base = 8; ptr++; - } - else + } else { base = 10; + } } /* Base 16 allows the 0x on front - so skip over it */ @@ -504,7 +504,7 @@ unsigned long long int strtoull(const char *ptr, char **endptr, int base) ptr += 2; } - for( ; *ptr && _valid(*ptr, base); ptr++) + for ( ; *ptr && _valid(*ptr, base); ptr++) ret = (ret * base) + _offset(*ptr, base); if (endptr != NULL) @@ -516,7 +516,8 @@ unsigned long long int strtoull(const char *ptr, char **endptr, int base) unsigned long int strtoul(const char *ptr, char **endptr, int base) { unsigned long long val = strtoull(ptr, endptr, base); - if (val > ULONG_MAX) return ULONG_MAX; + if (val > ULONG_MAX) + return ULONG_MAX; return val; } @@ -577,7 +578,7 @@ size_t strcspn(const char *s, const char *a) * @param ptr A pointer to a string pointer to keep state of the tokenizer * @return Pointer to token */ -char* strtok_r(char *str, const char *delim, char **ptr) +char *strtok_r(char *str, const char *delim, char **ptr) { /* start new tokenizing job or continue existing one? */ if (str == NULL) @@ -607,7 +608,7 @@ static char **strtok_global; * @param delim A pointer to an array of characters that delimit the token * @return Pointer to token */ -char* strtok(char *str, const char *delim) +char *strtok(char *str, const char *delim) { return strtok_r(str, delim, strtok_global); } |