summaryrefslogtreecommitdiffstats
path: root/src/basic/parse-util.c
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@vmware.com>2021-01-27 08:19:39 +0100
committerGitHub <noreply@github.com>2021-01-27 08:19:39 +0100
commitfe96c0f86d15e844d74d539c6cff7f971078cf84 (patch)
treecb4f1a6248826c163b766c1be5d82d882f9fbb28 /src/basic/parse-util.c
parentMerge pull request #18380 from yuwata/test-network-ipv6-proxy-ndp (diff)
downloadsystemd-fe96c0f86d15e844d74d539c6cff7f971078cf84.tar.xz
systemd-fe96c0f86d15e844d74d539c6cff7f971078cf84.zip
treewide: tighten variable scope in loops (#18372)
Also use _cleanup_free_ in one more place.
Diffstat (limited to 'src/basic/parse-util.c')
-rw-r--r--src/basic/parse-util.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c
index 8ca8f251e1..2a7280fc38 100644
--- a/src/basic/parse-util.c
+++ b/src/basic/parse-util.c
@@ -593,14 +593,13 @@ int safe_atod(const char *s, double *ret_d) {
}
int parse_fractional_part_u(const char **p, size_t digits, unsigned *res) {
- size_t i;
unsigned val = 0;
const char *s;
s = *p;
/* accept any number of digits, strtoull is limited to 19 */
- for (i=0; i < digits; i++,s++) {
+ for (size_t i = 0; i < digits; i++,s++) {
if (*s < '0' || *s > '9') {
if (i == 0)
return -EINVAL;