]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/avsscanf.c
avcodec: Constify all the AVCodecParsers
[ffmpeg] / libavutil / avsscanf.c
index 1c85412fd4d5945a4332fbd43f9551baf5a9da8d..b7f0f71c2d5e1837acb4d60a6d0135d8ce412eb4 100644 (file)
@@ -113,7 +113,7 @@ static int ffshgetc(FFFILE *f)
 }
 
 #define shlim(f, lim) ffshlim((f), (lim))
-#define shgetc(f) (((f)->rpos != (f)->shend) ? *(f)->rpos++ : ffshgetc(f))
+#define shgetc(f) (((f)->rpos < (f)->shend) ? *(f)->rpos++ : ffshgetc(f))
 #define shunget(f) ((f)->shend ? (void)(f)->rpos-- : (void)0)
 
 static const unsigned char table[] = { -1,
@@ -229,9 +229,9 @@ static long long scanexp(FFFILE *f, int pok)
         return LLONG_MIN;
     }
     for (x=0; c-'0'<10U && x<INT_MAX/10; c = shgetc(f))
-        x = 10*x + c-'0';
+        x = 10*x + (c-'0');
     for (y=x; c-'0'<10U && y<LLONG_MAX/100; c = shgetc(f))
-        y = 10*y + c-'0';
+        y = 10*y + (c-'0');
     for (; c-'0'<10U; c = shgetc(f));
     shunget(f);
     return neg ? -y : y;