summaryrefslogtreecommitdiff
path: root/rts/RtsFlags.c
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2016-04-18 22:32:59 +0200
committerBen Gamari <ben@smart-cactus.org>2016-04-18 23:09:18 +0200
commitd1ce35d2271ac8b79cb5e37677b1a989749e611c (patch)
treecafccb161304bf0f00320c4cc0e5966b8e8f6a39 /rts/RtsFlags.c
parent350ffc3e4c6b3aefd6ae621991564cc28f585d46 (diff)
downloadhaskell-d1ce35d2271ac8b79cb5e37677b1a989749e611c.tar.gz
rts: Don't use strndup
Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2125
Diffstat (limited to 'rts/RtsFlags.c')
-rw-r--r--rts/RtsFlags.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index 9db3cd4786..bffb1287e5 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -1597,7 +1597,7 @@ static rtsBool read_heap_profiling_flag(const char *arg_in)
if (!right)
right = arg + strlen(arg);
- char *selector = strndup(left, right - left);
+ char *selector = stgStrndup(left, right - left + 1);
switch (arg[2]) {
case 'c': // cost centre label select