isobusfs: fix printf format specifiers in log messages

Several log messages used format specifiers which did not match the
types of the provided arguments (e.g. %d or %i for size_t/ssize_t,
%ld for int64_t/time_t and size_t for the '.*' precision). On 64 bit
hosts (and for int64_t/time_t on 32 bit hosts) this leads to wrong
output or undefined behaviour when the log level is enabled.

Additionally the seek response position was compared to the requested
offset without le32toh() conversion which fails on big endian hosts.

Fix the format specifiers and add the missing le32toh() conversion.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This commit is contained in:
Oliver Hartkopp
2026-10-14 19:25:06 +02:00
parent 0f55228325
commit 8355b57133
8 changed files with 16 additions and 15 deletions
+2 -2
View File
@@ -287,7 +287,7 @@ static int isobusfs_srv_fa_open_file(struct isobusfs_srv_priv *priv,
return ret;
pr_debug("convert ISOBUS FS path to linux path: %.*s -> %s",
path_len, path, linux_path);
(int)path_len, path, linux_path);
/* Determine open flags based on the requested access type */
switch (flags & ISOBUSFS_FA_OPEN_MASK) {
@@ -847,7 +847,7 @@ send_response:
goto free_res;
}
pr_debug("> tx: Read File Response. Error code: %d (%s), read size: %d",
pr_debug("> tx: Read File Response. Error code: %d (%s), read size: %zd",
error_code, isobusfs_error_to_str(error_code), readed_size);
free_res: