mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-06 07:15:30 -04:00
scan-build: fix a couple of minor warnings from a scan-build run
This commit is contained in:
parent
9abc5ca971
commit
15b12f45c6
6 changed files with 7 additions and 5 deletions
4
csi.c
4
csi.c
|
|
@ -54,8 +54,8 @@ csi_as_string(struct terminal *term, uint8_t final)
|
||||||
i == term->vt.params.idx - 1 ? "" : ";");
|
i == term->vt.params.idx - 1 ? "" : ";");
|
||||||
}
|
}
|
||||||
|
|
||||||
c += snprintf(&msg[c], sizeof(msg) - c, "%c (%zu parameters)",
|
snprintf(&msg[c], sizeof(msg) - c, "%c (%zu parameters)",
|
||||||
final, term->vt.params.idx);
|
final, term->vt.params.idx);
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
2
log.c
2
log.c
|
|
@ -100,7 +100,7 @@ _sys_log(enum log_class log_class, const char *module,
|
||||||
idx += vsnprintf(&msg[idx], required_len + 1 - idx, fmt, va);
|
idx += vsnprintf(&msg[idx], required_len + 1 - idx, fmt, va);
|
||||||
|
|
||||||
if (sys_errno != 0) {
|
if (sys_errno != 0) {
|
||||||
idx += snprintf(
|
snprintf(
|
||||||
&msg[idx], required_len + 1 - idx, ": %s", strerror(sys_errno));
|
&msg[idx], required_len + 1 - idx, ": %s", strerror(sys_errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
1
main.c
1
main.c
|
|
@ -143,6 +143,7 @@ main(int argc, char *const *argv)
|
||||||
unsigned width, height;
|
unsigned width, height;
|
||||||
if (sscanf(optarg, "%ux%u", &width, &height) != 2 || width == 0 || height == 0) {
|
if (sscanf(optarg, "%ux%u", &width, &height) != 2 || width == 0 || height == 0) {
|
||||||
fprintf(stderr, "error: invalid geometry: %s\n", optarg);
|
fprintf(stderr, "error: invalid geometry: %s\n", optarg);
|
||||||
|
config_free(conf);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,7 @@ extract_selection(const struct terminal *term)
|
||||||
start_col = 0;
|
start_col = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(idx > 0);
|
||||||
assert(idx < buf_size);
|
assert(idx < buf_size);
|
||||||
if (buf[idx - 1] == '\n')
|
if (buf[idx - 1] == '\n')
|
||||||
buf[idx - 1] = '\0';
|
buf[idx - 1] = '\0';
|
||||||
|
|
|
||||||
2
shm.c
2
shm.c
|
|
@ -148,7 +148,7 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie)
|
||||||
|
|
||||||
/* We use the entire pool for our single buffer */
|
/* We use the entire pool for our single buffer */
|
||||||
wl_shm_pool_destroy(pool); pool = NULL;
|
wl_shm_pool_destroy(pool); pool = NULL;
|
||||||
close(pool_fd); pool_fd = -1;
|
close(pool_fd);
|
||||||
|
|
||||||
/* One pixman image for each worker thread (do we really need multiple?) */
|
/* One pixman image for each worker thread (do we really need multiple?) */
|
||||||
pix = pixman_image_create_bits_no_clear(
|
pix = pixman_image_create_bits_no_clear(
|
||||||
|
|
|
||||||
2
vt.c
2
vt.c
|
|
@ -581,7 +581,7 @@ esc_as_string(struct terminal *term, uint8_t final)
|
||||||
|
|
||||||
assert(term->vt.params.idx == 0);
|
assert(term->vt.params.idx == 0);
|
||||||
|
|
||||||
c += snprintf(&msg[c], sizeof(msg) - c, "%c", final);
|
snprintf(&msg[c], sizeof(msg) - c, "%c", final);
|
||||||
return msg;
|
return msg;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue