aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-08-28 11:07:54 -0400
committerTony Crisci <tony@dubstepdish.com>2017-08-28 11:07:54 -0400
commit4fbe322fa6fcdbfda6b7006869358fdb47caff6e (patch)
treeefa5c379010d01837e07b5239342cb77f5fe9fa8 /examples
parentab1a12b17463757cbbed4ad472797a8ed699671b (diff)
fix memory errors
Diffstat (limited to 'examples')
-rw-r--r--examples/pointer.c2
-rw-r--r--examples/touch.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/pointer.c b/examples/pointer.c
index 8ad18442..936bfb6a 100644
--- a/examples/pointer.c
+++ b/examples/pointer.c
@@ -274,7 +274,7 @@ static void handle_touch_up(struct wl_listener *listener, void *data) {
static void handle_touch_down(struct wl_listener *listener, void *data) {
struct sample_state *sample = wl_container_of(listener, sample, touch_down);
struct wlr_event_touch_down *event = data;
- struct touch_point *point = calloc(1, sizeof(struct touch_state));
+ struct touch_point *point = calloc(1, sizeof(struct touch_point));
point->slot = event->slot;
point->x = event->x_mm / event->width_mm;
point->y = event->y_mm / event->height_mm;
diff --git a/examples/touch.c b/examples/touch.c
index 7e8d9827..40fc4ca2 100644
--- a/examples/touch.c
+++ b/examples/touch.c
@@ -61,7 +61,7 @@ static void handle_output_frame(struct output_state *output, struct timespec *ts
static void handle_touch_down(struct touch_state *tstate, int32_t slot,
double x, double y, double width, double height) {
struct sample_state *sample = tstate->compositor->data;
- struct touch_point *point = calloc(1, sizeof(struct touch_state));
+ struct touch_point *point = calloc(1, sizeof(struct touch_point));
point->slot = slot;
point->x = x / width;
point->y = y / height;