Fix compilation warnings.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
diff --git a/display.c b/display.c
index 0000ee9..1114366 100644
--- a/display.c
+++ b/display.c
@@ -198,13 +198,13 @@
static int display_next_line(void)
{
- int maxx, maxy;
+ int maxy;
int cursor = windata[current_win].cursor;
int nrdata = windata[current_win].nrdata;
int scrolling = windata[current_win].scrolling;
struct rowdata *rowdata = windata[current_win].rowdata;
- getmaxyx(stdscr, maxy, maxx);
+ maxy = getmaxy(stdscr);
if (cursor >= nrdata)
return cursor;
@@ -320,9 +320,6 @@
const size_t len = 64;
regex_t *reg;
char *search4;
- int maxx, maxy;
-
- getmaxyx(stdscr, maxy, maxx);
reg = malloc(sizeof(*reg));
if (!reg)
diff --git a/gpio.c b/gpio.c
index 3c02b8e..7b5bbb2 100644
--- a/gpio.c
+++ b/gpio.c
@@ -325,12 +325,13 @@
FILE *fgpio, *fgpio_export;
int i, gpio_max = 0;
char *line = NULL;
- ssize_t read, len = 0;
+ ssize_t read;
+ size_t len = 0;
fgpio = fopen("/sys/kernel/debug/gpio", "r");
if (!fgpio) {
printf("failed to read debugfs gpio file\n");
- goto out;
+ return;
}
fgpio_export = fopen("/sys/class/gpio/export", "w");
@@ -342,7 +343,7 @@
/* export the gpios */
while ((read = getline(&line, &len, fgpio)) != -1) {
if (strstr(line, "GPIOs"))
- sscanf(line, "%*[^-]-%d%*", &gpio_max);
+ sscanf(line, "%*[^-]-%d", &gpio_max);
}
printf("log: total gpios = %d\n", gpio_max);
@@ -355,10 +356,10 @@
}
free(line);
-out:
+
if (fgpio)
fclose(fgpio);
-
+out:
if (fgpio_export)
fclose(fgpio_export);