13
0

remove useless test, fgets() already ensures MAX_STRING_LEN

Found by PVS-Studio - https://www.viva64.com/en/b/0540/
This commit is contained in:
Robin Gareus 2017-11-23 09:56:57 +01:00
parent 2fec64f0bd
commit 1a46ee716d

View File

@ -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,