From 1520fad9329a8385c8ac0676791ccb5055a8eb4f Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 16 Jul 2011 14:52:18 +0200 Subject: osmocon: get rid of some Smash warnings --- src/host/osmocon/osmocon.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/host/osmocon/osmocon.c') diff --git a/src/host/osmocon/osmocon.c b/src/host/osmocon/osmocon.c index 7f8d3ac7..2da711b2 100644 --- a/src/host/osmocon/osmocon.c +++ b/src/host/osmocon/osmocon.c @@ -335,10 +335,8 @@ int read_file(const char *filename) return -EFBIG; } - if (dnload.data) { - free(dnload.data); - dnload.data = NULL; - } + free(dnload.data); + dnload.data = NULL; if (dnload.mode == MODE_C140 || dnload.mode == MODE_C140xor) { if (st.st_size < (MAGIC_OFFSET + sizeof(phone_magic))) @@ -1551,8 +1549,10 @@ int main(int argc, char **argv) dnload.load_address[2] = (tmp_load_address >> 8) & 0xff; dnload.load_address[3] = tmp_load_address & 0xff; - while (1) - osmo_select_main(0); + while (1) { + if (osmo_select_main(0) < 0) + break; + } close(dnload.serial_fd.fd); -- cgit v1.2.3