Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/deviceinfo/device_info/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
*bufLength = length;

} else {
printf("ERROR: bufLength %d is too small for %d chars\n", *bufLength, totalLength);
printf("ERROR: bufLength %d is too small for %d chars\n", totalLength);

Check warning

Code scanning / Coverity

Printf arg count mismatch Warning

PW.TOO_FEW_PRINTF_ARGS: the format string requires additional arguments

Check warning

Code scanning / Coverity

Missing argument to printf format specifier Warning

PRINTF_ARGS: No argument for format specifier "%d".
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The printf format string expects two integer arguments ("%d" twice), but only one argument (totalLength) is provided. This is undefined behavior and will likely print garbage/crash. Pass both *bufLength and totalLength (and consider using "%u"/casting since these are uint32_t) to match the format string.

Suggested change
printf("ERROR: bufLength %d is too small for %d chars\n", totalLength);
printf("ERROR: bufLength %u is too small for %u chars\n", *bufLength, totalLength);

Copilot uses AI. Check for mistakes.
*bufLength = 0;
}
}
Expand Down
Loading