diff options
Diffstat (limited to 'ax25/axgetput/util.c')
-rw-r--r-- | ax25/axgetput/util.c | 15 |
1 files changed, 10 insertions, 5 deletions
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; |