aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmd.c2
-rw-r--r--tty.c17
-rw-r--r--utils.c2
3 files changed, 11 insertions, 10 deletions
diff --git a/cmd.c b/cmd.c
index 15a63d6..48e72c0 100644
--- a/cmd.c
+++ b/cmd.c
@@ -1342,7 +1342,7 @@ static void cmd_exe __P1 (char *,arg)
* the \\\n and do another fgets */
if (buf[offset + strlen(buf + offset) - 2] == '\\') {
/* Clear \n prefixed with a literal backslash '\\' */
- if (clear = strstr(buf + offset, "\\\n"))
+ if ((clear = strstr(buf + offset, "\\\n")))
*clear = '\0';
offset += strlen(buf + offset);
} else {
diff --git a/tty.c b/tty.c
index f9b28e7..6fa62d7 100644
--- a/tty.c
+++ b/tty.c
@@ -478,10 +478,10 @@ void tty_add_initial_binds __P0 (void)
add_keynode(p->label, p->seq, 0, p->funct, NULL);
} while((++p)->seq[0]);
- if (cursor_left ) add_keynode("Left" , cursor_left , 0, prev_char, NULL);
- if (cursor_right) add_keynode("Right", cursor_right, 0, next_char, NULL);
- if (cursor_up ) add_keynode("Up" , cursor_up , 0, prev_line, NULL);
- if (cursor_down ) add_keynode("Down" , cursor_down , 0, next_line, NULL);
+ if (*cursor_left ) add_keynode("Left" , cursor_left , 0, prev_char, NULL);
+ if (*cursor_right) add_keynode("Right", cursor_right, 0, next_char, NULL);
+ if (*cursor_up ) add_keynode("Up" , cursor_up , 0, prev_line, NULL);
+ if (*cursor_down ) add_keynode("Down" , cursor_down , 0, next_line, NULL);
}
#ifndef USE_VT100
@@ -853,7 +853,8 @@ int tty_read __P ((char *buf, size_t count))
int result = 0;
int converted;
wchar_t wc;
-
+ int did_read = 0, should_read = 0;
+
if (count && tty_in_buf_used) {
converted = mbtowc(&wc, tty_in_buf, tty_in_buf_used);
if (converted >= 0)
@@ -861,9 +862,9 @@ int tty_read __P ((char *buf, size_t count))
}
while (count) {
- int should_read = sizeof tty_in_buf - tty_in_buf_used;
- int did_read = read(tty_read_fd, tty_in_buf + tty_in_buf_used,
- should_read);
+ should_read = sizeof tty_in_buf - tty_in_buf_used;
+ did_read = read(tty_read_fd, tty_in_buf + tty_in_buf_used,
+ should_read);
if (did_read < 0 && errno == EINTR)
continue;
diff --git a/utils.c b/utils.c
index 06018d7..76391a9 100644
--- a/utils.c
+++ b/utils.c
@@ -959,7 +959,7 @@ int read_settings __P0 (void)
left -= n;
/* Clear all \n prefixed with a literal backslash '\\' */
- while( cmd = strstr( buf, "\\\n" ) ) {
+ while ((cmd = strstr(buf, "\\\n"))) {
cmd[ 0 ] = ' ';
cmd[ 1 ] = ' ';
}