projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d9ff009
)
Use field width of 9 on sscanf (fixes cppcheck portability issues)
author
Tobias Markus
<tobbi@mozilla-uk.org>
Thu, 22 Jan 2015 16:05:03 +0000
(17:05 +0100)
committer
Tobias Markus
<tobbi@mozilla-uk.org>
Thu, 22 Jan 2015 16:05:03 +0000
(17:05 +0100)
src/supertux/command_line_arguments.cpp
patch
|
blob
|
history
diff --git
a/src/supertux/command_line_arguments.cpp
b/src/supertux/command_line_arguments.cpp
index
843f23d
..
fb788a3
100644
(file)
--- a/
src/supertux/command_line_arguments.cpp
+++ b/
src/supertux/command_line_arguments.cpp
@@
-195,7
+195,7
@@
CommandLineArguments::parse_args(int argc, char** argv)
else
{
int width, height;
- if (sscanf(argv[i], "%
dx%
d", &width, &height) != 2)
+ if (sscanf(argv[i], "%
9dx%9
d", &width, &height) != 2)
{
throw std::runtime_error("Invalid geometry spec, should be WIDTHxHEIGHT");
}
@@
-223,7
+223,7
@@
CommandLineArguments::parse_args(int argc, char** argv)
aspect_width = 0;
aspect_height = 0;
}
- else if (sscanf(argv[i], "%
d:%
d", &aspect_width, &aspect_height) != 2)
+ else if (sscanf(argv[i], "%
9d:%9
d", &aspect_width, &aspect_height) != 2)
{
throw std::runtime_error("Invalid aspect spec, should be WIDTH:HEIGHT or auto");
}