diff options
author | emersion <contact@emersion.fr> | 2018-07-02 09:06:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-02 09:06:02 +0100 |
commit | defb73596fedec846280b9155bb3e9d210da49bb (patch) | |
tree | 0a3e6c9e5efaf0e8bb5f01ab7691350cd063ebcb /common | |
parent | Merge pull request #2190 from emersion/screencopy (diff) | |
parent | swaylock daemonize: fix leak of devnull fd (diff) | |
download | sway-defb73596fedec846280b9155bb3e9d210da49bb.tar.gz sway-defb73596fedec846280b9155bb3e9d210da49bb.tar.zst sway-defb73596fedec846280b9155bb3e9d210da49bb.zip |
Merge pull request #2186 from martinetd/static-analysis
Static analysis fixes
Diffstat (limited to 'common')
-rw-r--r-- | common/unicode.c | 2 | ||||
-rw-r--r-- | common/util.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/common/unicode.c b/common/unicode.c index 38a9b48e..5070e083 100644 --- a/common/unicode.c +++ b/common/unicode.c | |||
@@ -92,7 +92,7 @@ static const struct { | |||
92 | 92 | ||
93 | int utf8_size(const char *s) { | 93 | int utf8_size(const char *s) { |
94 | uint8_t c = (uint8_t)*s; | 94 | uint8_t c = (uint8_t)*s; |
95 | for (size_t i = 0; i < sizeof(sizes) / 2; ++i) { | 95 | for (size_t i = 0; i < sizeof(sizes) / sizeof(*sizes); ++i) { |
96 | if ((c & sizes[i].mask) == sizes[i].result) { | 96 | if ((c & sizes[i].mask) == sizes[i].result) { |
97 | return sizes[i].octets; | 97 | return sizes[i].octets; |
98 | } | 98 | } |
diff --git a/common/util.c b/common/util.c index fb7f9454..678926ed 100644 --- a/common/util.c +++ b/common/util.c | |||
@@ -95,7 +95,7 @@ pid_t get_parent_pid(pid_t child) { | |||
95 | token = strtok(NULL, sep); // parent pid | 95 | token = strtok(NULL, sep); // parent pid |
96 | parent = strtol(token, NULL, 10); | 96 | parent = strtol(token, NULL, 10); |
97 | } | 97 | } |
98 | 98 | free(buffer); | |
99 | fclose(stat); | 99 | fclose(stat); |
100 | } | 100 | } |
101 | 101 | ||