* Noteworthy changes in release ?.? (????-??-??) [?]
+** Bug fixes
+
+ printf '%d' '"' no longer accesses out-of-bounds memory in the diagnostic.
+ [bug introduced in sh-utils-1.16]
+
** New features
split accepts a new --filter=CMD option. With it, split filters output
Paul D. Smith psmith@gnu.org
Paul Ghaleb paul.ghaleb@st.com
Paul Jarc prj@po.cwru.edu
+Paul Marinescu paul.marinescu@imperial.ac.uk
Paul Nevai nevai@ops.mps.ohio-state.edu
Paul Sauer paul@alexa.com
Paul Slootman paul@debian.org
char *end; \
TYPE val; \
\
- if (*s == '\"' || *s == '\'') \
+ if ((*s == '\"' || *s == '\'') && *(s + 1)) \
{ \
unsigned char ch = *++s; \
val = ch; \
compare out exp || fail=1
+# Verify handling of single quote chars (\' or \")
+
+"$prog" '%d\n' '"a' >out 2>err # valid
+"$prog" '%d\n' '"a"' >>out 2>>err # invalid
+"$prog" '%d\n' '"' >>out 2>>err # invalid
+"$prog" '%d\n' 'a' >>out 2>>err # invalid
+
+cat <<EOF > exp
+97
+97
+0
+0
+EOF
+
+cat <<EOF > exp_err
+$prog: warning: ": character(s) following character constant have been ignored
+$prog: ": expected a numeric value
+$prog: a: expected a numeric value
+EOF
+
+compare out exp || fail=1
+compare err exp_err || fail=1
+
Exit $fail