summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2021-02-26 00:19:58 +0100
committerAlbert Astals Cid <tsdgeos@yahoo.es>2021-02-25 23:22:14 +0000
commit31734dcb365e2b69d88c86ddaee3bd62af97fade (patch)
treeb609e4358e2c362864d36524a69030aa673429d4
parent03b6705006e563c95cfcad47fa3d3c4c2e248651 (diff)
strtok -> strtok_r
Otherwise we have threading issues if two threads are doing strtok at the same time Fixes issue #1050
-rw-r--r--fofi/FoFiType1.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/fofi/FoFiType1.cc b/fofi/FoFiType1.cc
index 5a6b11b4..25d38452 100644
--- a/fofi/FoFiType1.cc
+++ b/fofi/FoFiType1.cc
@@ -13,7 +13,7 @@
// All changes made under the Poppler project to this file are licensed
// under GPL version 2 or later
//
-// Copyright (C) 2005, 2008, 2010, 2018 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2005, 2008, 2010, 2018, 2021 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2005 Kristian Høgsberg <krh@redhat.com>
// Copyright (C) 2010 Jakub Wilk <jwilk@jwilk.net>
// Copyright (C) 2014 Carlos Garcia Campos <carlosgc@gnome.org>
@@ -335,7 +335,7 @@ void FoFiType1::parse()
if ((p2 = strchr(p, ']'))) {
*p2 = '\0';
for (j = 0; j < 6; ++j) {
- if ((p = strtok(j == 0 ? p : nullptr, " \t\n\r"))) {
+ if ((p = strtok_r(j == 0 ? p : nullptr, " \t\n\r", &tokptr))) {
fontMatrix[j] = atof(p);
} else {
break;