Fixing a few last cppcheck errors/warnings

Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
This commit is contained in:
Raphael Defosseux
2019-02-19 17:42:27 +01:00
parent 6a47f9e775
commit 9aab83c509
8 changed files with 11 additions and 8 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ void unregister_notifier(gui *_g, unsigned long notifier_id) {
if (g->notifiers[i].id == notifier_id) break;
if (i == g->notifiers_count)
ERR("%s:%d: notifier_id %ld not found\n", __FILE__,__LINE__,notifier_id);
ERR("%s:%d: notifier_id %lu not found\n", __FILE__,__LINE__,notifier_id);
free(g->notifiers[i].notification);
memmove(g->notifiers + i, g->notifiers + i + 1,
+1
View File
@@ -261,6 +261,7 @@ int main(int n, char **v)
if (fds == NULL) { perror("calloc"); exit(1); }
}
i = 0;
if (fds == NULL) { perror("null fds pointer"); exit(1); }
fds[i].fd = l;
fds[i].events = POLLIN;
i++;
+5
View File
@@ -195,5 +195,10 @@ int main(int n, char **v)
handle_event(h, e);
}
if (on_off_name != NULL)
free(on_off_name);
if (on_off_action != NULL)
free(on_off_action);
return 0;
}
+1 -1
View File
@@ -273,6 +273,6 @@ void PUTX2(OBUF *o, int i) {
void PUTUL(OBUF *o, unsigned long l) {
char s[128];
sprintf(s, "%ld", l);
sprintf(s, "%lu", l);
PUTS(o, s);
}