[MPlayer-dev-eng] [PATCH] fix signed/unsigned comparison in m_option.c
Dominik 'Rathann' Mierzejewski
dominik at rangers.eu.org
Sun Oct 8 17:06:54 CEST 2006
strlen/strcspn return type is size_t, hence optlen should be size_t as well
(or ther should be a cast).
Fixes
m_option.c: In function ‘parse_subconf’:
m_option.c:928: warning: comparison between signed and unsigned
--
MPlayer developer and RPMs maintainer: http://rpm.greysector.net/mplayer/
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
-- from "Collected Sayings of Muad'Dib" by the Princess Irulan
-------------- next part --------------
--- MPlayer-20114/m_option.c.warn 2006-10-08 16:11:54.000000000 +0200
+++ MPlayer-20114/m_option.c 2006-10-08 16:20:24.000000000 +0200
@@ -904,7 +904,7 @@
while(p[0])
{
int sscanf_ret = 1;
- int optlen = strcspn(p, ":=");
+ size_t optlen = strcspn(p, ":=");
/* clear out */
subopt[0] = subparam[0] = 0;
strlcpy(subopt, p, optlen + 1);
@@ -926,7 +926,7 @@
p = &p[1];
optlen = (int)strtol(p, &p, 0);
if (!p || p[0] != '%' || (optlen > strlen(p) - 1)) {
- mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Invalid length %i for '%s'\n", optlen, subopt);
+ mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Invalid length %li for '%s'\n", optlen, subopt);
return M_OPT_INVALID;
}
p = &p[1];
More information about the MPlayer-dev-eng
mailing list