aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean.guyomarch@gmail.com>2016-01-30 22:36:34 +0100
committerJean Guyomarc'h <jean@guyomarch.bzh>2016-09-09 19:58:36 +0200
commite13f5f19e4a57f389aa73e70e37dcf801659b074 (patch)
tree614eeed7bd002c84418a40d2a771a093a39a4532
parenttyalpha: don't call strlen() (diff)
downloadterminology-e13f5f19e4a57f389aa73e70e37dcf801659b074.tar.gz
tyls: don't call strlen()
-rw-r--r--src/bin/tyls.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/tyls.c b/src/bin/tyls.c
index 9b5ef08..1496bcc 100644
--- a/src/bin/tyls.c
+++ b/src/bin/tyls.c
@@ -759,9 +759,9 @@ main(int argc, char **argv)
evas = ecore_evas_get(ee);
echo_off();
- snprintf(buf, sizeof(buf), "%c}qs", 0x1b);
- len = strlen(buf);
- if (write(STDIN_FILENO, buf, len + 1) < (signed)len + 1) perror("write");
+ len = snprintf(buf, sizeof(buf), "%c}qs", 0x1b);
+ len++;
+ if (write(STDIN_FILENO, buf, len) < len) perror("write");
if ((scanf("%i;%i;%i;%i", &tw, &th, &cw, &ch) != 4)
|| (tw <= 0) || (th <= 0) || (cw <= 1) || (ch <= 1))
{