diff options
Diffstat (limited to 'ax25/axgetput')
-rw-r--r-- | ax25/axgetput/proto_bin.c | 3 | ||||
-rw-r--r-- | ax25/axgetput/util.c | 15 |
2 files changed, 12 insertions, 6 deletions
diff --git a/ax25/axgetput/proto_bin.c b/ax25/axgetput/proto_bin.c index 69d12a4..7d5eb3a 100644 --- a/ax25/axgetput/proto_bin.c +++ b/ax25/axgetput/proto_bin.c @@ -484,7 +484,8 @@ int bget(void) { } if (fdin_is_pipe && !is_stream) { sl = stored_file; - if (!(stored_file = stored_file->next)) + stored_file = stored_file->next; + if (!stored_file) is_eof = 1; free(sl); } diff --git a/ax25/axgetput/util.c b/ax25/axgetput/util.c index a4a83c0..69adb60 100644 --- a/ax25/axgetput/util.c +++ b/ax25/axgetput/util.c @@ -116,19 +116,23 @@ char *get_fixed_filename(char *line, long size, unsigned int msg_crc, int genera *filename = 0; - if ((p = strchr(line, '\"'))) { + p = strchr(line, '\"'); + if (p) { p++; } /* security.. */ - if ((q = strrchr((p ? p : line), '/'))) { + q = strrchr((p ? p : line), '/'); + if (q) { p = ++q; } - if ((q = strrchr((p ? p : line), '\\'))) { + q = strrchr((p ? p : line), '\\'); + if (q) { p = ++q; } - if ((q = strrchr((p ? p : line), ':'))) { + q = strrchr((p ? p : line), ':'); + if (q) { p = ++q; } if (!p) { @@ -144,7 +148,8 @@ char *get_fixed_filename(char *line, long size, unsigned int msg_crc, int genera } *r = 0; strtrim(filename); - if ((q = strrchr(filename, '.'))) { + q = strrchr(filename, '.'); + if (q) { if (!*(q+1)) { /* remove trailing dots */ *q = 0; |