From ee47ac2a5b69573ceef3d283914d2f490598908d Mon Sep 17 00:00:00 2001 From: Miles Alan Date: Sun, 12 Jul 2020 21:25:01 -0500 Subject: [PATCH] Remove extra variable --- lisgd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lisgd.c b/lisgd.c index ec60710..5adfbfa 100644 --- a/lisgd.c +++ b/lisgd.c @@ -294,12 +294,11 @@ main(int argc, char *argv[]) orientation = atoi(argv[++i]); } else if (!strcmp(argv[i], "-g")) { gestsarrlen++; - void *ptr = realloc(gestsarr, (gestsarrlen * sizeof(Gesture))); - if ( ptr == NULL ) { + gestsarr = realloc(gestsarr, (gestsarrlen * sizeof(Gesture))); + if (gestsarr == NULL) { perror("Could not allocate memory"); exit(EXIT_FAILURE); } - gestsarr = ptr; gestpt = strtok(argv[++i], ","); for (j = 0; gestpt != NULL && j < 3; gestpt = strtok(NULL, ","), j++) { switch(j) { -- 2.45.2