summaryrefslogtreecommitdiff
path: root/libs/ardour/vst_info_file.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-11-23 09:56:57 +0100
committerRobin Gareus <robin@gareus.org>2017-11-23 09:56:57 +0100
commit1a46ee716dbcbf452e7aa3d3312cf81310f1ff20 (patch)
tree48227b0825ae1052c9bca45612abb14265ddd9b2 /libs/ardour/vst_info_file.cc
parent2fec64f0bd3aa3dcd2057a2594350b1dba100ecf (diff)
remove useless test, fgets() already ensures MAX_STRING_LEN
Found by PVS-Studio - https://www.viva64.com/en/b/0540/
Diffstat (limited to 'libs/ardour/vst_info_file.cc')
-rw-r--r--libs/ardour/vst_info_file.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/ardour/vst_info_file.cc b/libs/ardour/vst_info_file.cc
index b076c42227..d58b7a94a5 100644
--- a/libs/ardour/vst_info_file.cc
+++ b/libs/ardour/vst_info_file.cc
@@ -259,14 +259,14 @@ read_string (FILE *fp)
return 0;
}
- if (strlen (buf) < MAX_STRING_LEN) {
- if (strlen (buf)) {
- buf[strlen (buf)-1] = 0;
- }
+ if (strlen (buf)) {
+ /* strip lash char here: '\n',
+ * since VST-params cannot be longer than 127 chars.
+ */
+ buf[strlen (buf)-1] = 0;
return strdup (buf);
- } else {
- return 0;
}
+ return 0;
}
/** Read an integer value from a line in fp into n,