changeset 28758:f8625bfd9aa5

Use strtoll in parse_int to avoid discrepancies between 32 and 64 bit systems.
author reimar
date Mon, 02 Mar 2009 11:10:11 +0000
parents 8d5ed38e08d4
children af274aef6b81
files m_option.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/m_option.c	Mon Mar 02 11:06:05 2009 +0000
+++ b/m_option.c	Mon Mar 02 11:10:11 2009 +0000
@@ -137,16 +137,16 @@
 // Integer
 
 static int parse_int(const m_option_t* opt,const char *name, char *param, void* dst, int src) {
-  long tmp_int;
+  long long tmp_int;
   char *endptr;
   src = 0;
 
   if (param == NULL)
     return M_OPT_MISSING_PARAM;
 
-  tmp_int = strtol(param, &endptr, 10);
+  tmp_int = strtoll(param, &endptr, 10);
   if (*endptr)
-    tmp_int = strtol(param, &endptr, 0);
+    tmp_int = strtoll(param, &endptr, 0);
   if (*endptr) {
     mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The %s option must be an integer: %s\n",name, param);
     return M_OPT_INVALID;