diff options
author | dteske <dteske@FreeBSD.org> | 2013-11-07 10:45:25 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2013-11-07 10:45:25 +0000 |
commit | 5d865ae5b7b82b5861d4d959c0299b01270aec0f (patch) | |
tree | 3d4e71dcbd1bf3b498c5b038fb51f47e3dfd3afd | |
parent | e2c65ece90c767635cfa4d44f90de9206c7a9a9b (diff) | |
download | FreeBSD-src-5d865ae5b7b82b5861d4d959c0299b01270aec0f.zip FreeBSD-src-5d865ae5b7b82b5861d4d959c0299b01270aec0f.tar.gz |
Fix a bug where a format with leading `-' could be mistaken for printf
getopts argument(s).
-rw-r--r-- | usr.sbin/bsdconfig/share/strings.subr | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/bsdconfig/share/strings.subr b/usr.sbin/bsdconfig/share/strings.subr index 595825d..0072aa7 100644 --- a/usr.sbin/bsdconfig/share/strings.subr +++ b/usr.sbin/bsdconfig/share/strings.subr @@ -66,7 +66,8 @@ f_snprintf() { local __var_to_set="$1" __size="$2" shift 2 # var_to_set size - eval "$__var_to_set"=\$\( printf \"\$@\" \| awk -v max=\"\$__size\" \'' + eval "$__var_to_set"=\$\( printf -- \"\$@\" \| \ + awk -v max=\"\$__size\" \'' { len = length($0) max -= len |