Skip to content

Conversation

ptrgits
Copy link

@ptrgits ptrgits commented Aug 13, 2025

fix the problem, we need to ensure that the number of arguments passed to vprint matches the number of format specifiers in the format string. In this case, the format string "%s, %s, %s, path %s\n" expects four arguments, but only three are provided. The best fix is to determine what the fourth argument should be. Based on the context, the format string is printing out some directory and file information. The three arguments provided are qdir, gamedir, and g_outfile. The format string also includes "path %s", suggesting that a path variable should be printed. If there is a variable representing the path (possibly fullpath), it should be passed as the fourth argument. If not, and if only three items are intended to be printed, the format string should be changed to only include three %s specifiers.

The most likely intended variable for "path %s" is g_outfile or fullpath. Since g_outfile is already passed as the third argument, and fullpath is set just below this code, it makes sense to use fullpath as the fourth argument. line 3217 in src/utils/motionmapper/motionmapper.cpp to add fullpath as the fourth argument to vprint.

References

CERT C Coding Standard: FIO47-C. Use valid format strings
Microsoft C Runtime Library Reference: printf, wprintf

dimhotepus added a commit to Source-Authors/Obsoletium that referenced this pull request Aug 13, 2025
@ptrgits ptrgits closed this by deleting the head repository Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant