aboutsummaryrefslogtreecommitdiff
path: root/vis-cmds.c
diff options
context:
space:
mode:
authorRandy Palamar <palamar@ualberta.ca>2023-07-18 05:41:25 -0600
committerRandy Palamar <palamar@ualberta.ca>2023-07-18 05:43:10 -0600
commit599ced0bfc378682053484a9658bd59c02c96973 (patch)
tree4f01b89aeefe1ade1a2ba7a2d417272b65a3ec75 /vis-cmds.c
parent6be370defdede80b300aa0b9b39e25276628e158 (diff)
downloadvis-599ced0bfc378682053484a9658bd59c02c96973.tar.gz
vis-599ced0bfc378682053484a9658bd59c02c96973.tar.xz
fix warning about field width not being an int
this slipped through in commit 6be370d
Diffstat (limited to 'vis-cmds.c')
-rw-r--r--vis-cmds.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/vis-cmds.c b/vis-cmds.c
index 48a5091..2993267 100644
--- a/vis-cmds.c
+++ b/vis-cmds.c
@@ -632,8 +632,8 @@ static bool cmd_earlier_later(Vis *vis, Win *win, Command *cmd, const char *argv
return pos != EPOS;
}
-static size_t space_replace(char *dest, const char *src, size_t dlen) {
- size_t i, invisiblebytes = 0, size = strlen("␣");
+static int space_replace(char *dest, const char *src, size_t dlen) {
+ int i, invisiblebytes = 0, size = strlen("␣");
for (i = 0; *src && i < dlen; src++) {
if (*src == ' ' && i < dlen - size - 1) {
memcpy(&dest[i], "␣", size);
@@ -650,7 +650,7 @@ static size_t space_replace(char *dest, const char *src, size_t dlen) {
static bool print_keylayout(const char *key, void *value, void *data) {
char buf[64];
- size_t invisiblebytes = space_replace(buf, key, sizeof(buf));
+ int invisiblebytes = space_replace(buf, key, sizeof(buf));
return text_appendf(data, " %-*s\t%s\n", 18+invisiblebytes, buf, (char*)value);
}
@@ -660,7 +660,7 @@ static bool print_keybinding(const char *key, void *value, void *data) {
if (!desc && binding->action)
desc = VIS_HELP_USE(binding->action->help);
char buf[64];
- size_t invisiblebytes = space_replace(buf, key, sizeof(buf));
+ int invisiblebytes = space_replace(buf, key, sizeof(buf));
return text_appendf(data, " %-*s\t%s\n", 18+invisiblebytes, buf, desc ? desc : "");
}