From 4a44ee69d45616c02e40f2c3760a5a640e560773 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net>
Date: Sun, 11 Jul 2010 18:22:29 +0300
Subject: [PATCH] Fix reading integers from vlcrc

---
 src/config/file.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/config/file.c b/src/config/file.c
index b802ce3d4035..71a02df8e672 100644
--- a/src/config/file.c
+++ b/src/config/file.c
@@ -145,13 +145,15 @@ static int64_t strtoi (const char *str)
 
     if (!errno)
     {
-        if ((l > INT64_C(0x7fffffffffffffff))
-         || (l < INT64_C(-0x8000000000000000)))
+#if (LLONG_MAX > 0x7fffffffffffffffLL)
+        if (l > 0x7fffffffffffffffLL
+         || l < -0x8000000000000000LL)
             errno = ERANGE;
+#endif
         if (*end)
             errno = EINVAL;
     }
-    return (int)l;
+    return l;
 }
 
 #undef config_LoadConfigFile
-- 
GitLab