aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2020-06-04 08:23:40 +0200
committerMattias Andrée <maandree@kth.se>2020-06-04 08:23:40 +0200
commit9fd4e8c75d281ea6783344c5ee13e39777b59bd7 (patch)
tree10f372691b4654abd1841385f9b811d7cae8f8f4
parentBreak trigraph sequences in trace output (diff)
downloadsctrace-9fd4e8c75d281ea6783344c5ee13e39777b59bd7.tar.gz
sctrace-9fd4e8c75d281ea6783344c5ee13e39777b59bd7.tar.bz2
sctrace-9fd4e8c75d281ea6783344c5ee13e39777b59bd7.tar.xz
Bug fix: use inclusive check to test parsed long int fits in int
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index 8e9a971..b2d8341 100644
--- a/util.c
+++ b/util.c
@@ -92,7 +92,7 @@ xfopen(const char *file, const char *mode)
tmp = strtol(num, (void *)&num, 10);
if (!errno && tmp >= 0 &&
#if INT_MAX < LONG_MAX
- tmp < INT_MAX &&
+ tmp <= INT_MAX &&
#endif
!*num) {
ret = fdopen((int)tmp, mode);