shithub: riscv

Download patch

ref: 34c7af22c16781bbe9e415a7c25ec54a32acff8a
parent: 0431ea242d8856c5a780ab3a01252f3909349a49
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Jul 23 15:25:28 EDT 2018

libdraw: accept unsigned msec timestamp in /dev/mouse

--- a/sys/src/libdraw/event.c
+++ b/sys/src/libdraw/event.c
@@ -396,7 +396,7 @@
 	m.buttons = b;
 	m.xy.x = atoi((char*)eb->buf+1+0*12);
 	m.xy.y = atoi((char*)eb->buf+1+1*12);
-	m.msec = atoi((char*)eb->buf+1+3*12);
+	m.msec = (ulong)atoll((char*)eb->buf+1+3*12);
 	if (logfid)
 		fprint(logfid, "b: %d xy: %P\n", m.buttons, m.xy);
 	free(eb);
@@ -470,6 +470,6 @@
 	m->xy.x = atoi(buf+1+0*12);
 	m->xy.y = atoi(buf+1+1*12);
 	m->buttons = atoi(buf+1+2*12);
-	m->msec = atoi(buf+1+3*12);
+	m->msec = (ulong)atoll(buf+1+3*12);
 	return n;
 }
--- a/sys/src/libdraw/mouse.c
+++ b/sys/src/libdraw/mouse.c
@@ -73,7 +73,7 @@
 			m.xy.x = atoi(buf+1+0*12);
 			m.xy.y = atoi(buf+1+1*12);
 			m.buttons = atoi(buf+1+2*12);
-			m.msec = atoi(buf+1+3*12);
+			m.msec = (ulong)atoll(buf+1+3*12);
 			if(send(mc->c, &m) < 0)
 				continue;
 			/*