actions: make a load of functions static

Add a load of missing statics to functions internal to action.c

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: add parse_number() helper for numeric command line options

Replace separate strtol() calls with a new helper for the
-processors, -read-queue, -write-queue and -fragment-queue
options which adds checks for int overflow.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: Check for number before k/K/m/M quantity

Tighten up parsing for -b block number

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: check for trailing junk after k/K/m/M

Tighten up parsing for -b block number.

Originally Mksquashfs deliberately didn't check for trailing junk
after the k/K/m/M as this allowed things such as 1Mbyte to be
parsed.  However, this means rubbish such as 1mjjjsjdlj is parsed
as OK.

Given the whole point of the current exercise is to tighten up
{un/mk}squasfs' detection of bogus user input after CVEs were raised
against it, it seems silly to keep this feature.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: parse_number(), rename arg and b to be more self-documenting

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
actions: parse_number(), rename arg and b to be more self-documenting

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
unsquashfs: parse_number(), add additional comment re strtol {under/over}flow

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: parse_number(), add additional comment re strtol {under/over}flow

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
actions: parse_number(), check for strtoll conversion error

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquasfs: check return value of fstat() in reader_read_file() for error

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
pseudo: Mark fallthrough in case statement as intended

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: dynamically allocate filename in old_add_exclude()

rather than allocating it on the stack.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
unsquashfs: dynamically allocate pathname in dir_scan()

rather than allocating it on the stack.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
unsquashfs: dynamically allocate pathname in pre_scan()

rather than allocating it on the stack.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
sort: dynamically allocate filename in add_sort_list()

rather than allocating it on the stack.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: fix dir_scan() exit if lstat of source directory fails

If the source directory has disappeared between scanning it and
generating the filesystem, then abort.  Previously, in the very
unlikely event this check triggered, dir_scan() would return
silently having generated no filesystem.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
pseudo: fix memory leak in read_pseudo_def() if exec_file() fails

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
pseudo: dynamically allocate path in dump_pseudo()

rather than allocating it on the stack.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
mksquashfs: dynamically allocate path in display_path2()

rather than allocating it on the stack.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Mark temporary strings on stack used by regerror as overflow safe

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>