summaryrefslogtreecommitdiff
path: root/sys/src/9/port/devcons.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2019-12-11 23:52:05 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2019-12-11 23:52:05 +0100
commit52e4e51b50589ecb2b06559c28b7ce9f682815be (patch)
treed5e977b65d655576679026a19194036b6dcb4721 /sys/src/9/port/devcons.c
parentb0384439590d2899456b84b785b365a616ffaf2c (diff)
devcons: fix write length of writebintime() (thanks BurnZeZ)
Diffstat (limited to 'sys/src/9/port/devcons.c')
-rw-r--r--sys/src/9/port/devcons.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/src/9/port/devcons.c b/sys/src/9/port/devcons.c
index 79698c408..551e4b5b2 100644
--- a/sys/src/9/port/devcons.c
+++ b/sys/src/9/port/devcons.c
@@ -913,7 +913,8 @@ writebintime(char *buf, int n)
vlong delta;
long period;
- n--;
+ if(--n <= 0)
+ error(Ebadtimectl);
p = (uchar*)buf + 1;
switch(*buf){
case 'n':
@@ -938,7 +939,7 @@ writebintime(char *buf, int n)
todsetfreq(fasthz);
break;
}
- return n;
+ return n+1;
}
void