atom feed1 message in org.freebsd.freebsd-commitone-line change in sysctl
FromSent OnAttachments
Luigi RizzoAug 19, 1996 8:17 am 
Subject:one-line change in sysctl
From:Luigi Rizzo (lui@labinfo.iet.unipi.it)
Date:Aug 19, 1996 8:17:18 am
List:org.freebsd.freebsd-commit

The following one-line change to sysctl allows one to use hexadecimal constants in setting integer variables. Would someone care to apply it ? This is for -current as of today (19aug96) but the same applies to 2.1.X No changes to the manpage are necessary, I think.

Luigi

# diff -bwu sysctl.c.orig sysctl.c --- sysctl.c.orig Mon Aug 19 16:54:49 1996 +++ sysctl.c Mon Aug 19 16:55:19 1996 @@ -166,7 +166,7 @@

switch (kind & CTLTYPE) { case CTLTYPE_INT: - intval = atoi(newval); + sscanf(newval, "%i", &intval); newval = &intval; newsize = sizeof intval; break;