projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0420bf0
)
cmdutils: add OPT_INT check in parse_number_or_die()
author
Stefano Sabatini
<stefano.sabatini-lala@poste.it>
Sat, 16 Apr 2011 11:41:53 +0000
(13:41 +0200)
committer
Anton Khirnov
<anton@khirnov.net>
Tue, 10 May 2011 05:15:24 +0000
(07:15 +0200)
Check that the value passed for an OPT_INT option is an int, fail
otherwise.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
cmdutils.c
patch
|
blob
|
history
diff --git
a/cmdutils.c
b/cmdutils.c
index
59f0ce7
..
f957788
100644
(file)
--- a/
cmdutils.c
+++ b/
cmdutils.c
@@
-107,6
+107,8
@@
double parse_number_or_die(const char *context, const char *numstr, int type, do
error= "The value for %s was %s which is not within %f - %f\n";
else if(type == OPT_INT64 && (int64_t)d != d)
error= "Expected int64 for %s but found %s\n";
+ else if (type == OPT_INT && (int)d != d)
+ error= "Expected int for %s but found %s\n";
else
return d;
fprintf(stderr, error, context, numstr, min, max);