1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Trim spaces at the end of the buffer before trying to convert it to an oid

This allows to write entries in sysctl.conf with spaces before the '=' like
kern.ipc.shmmax = 9663676416

MFC after:	1 week
Sponsored by:	Gandi.net
This commit is contained in:
Baptiste Daroussin 2015-10-07 08:56:01 +00:00
parent 023d10cbc7
commit ca587fdaac
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=288981

View File

@ -262,6 +262,12 @@ parse(const char *string, int lineno)
newvalstr = cp;
newsize = strlen(cp);
}
/* Trim spaces */
cp = bufp + strlen(bufp) - 1;
while (cp >= bufp && isspace((int)*cp)) {
*cp = '\0';
cp--;
}
len = name2oid(bufp, mib);
if (len < 0) {