Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/usr.bin/vis

Module Name:    src
Committed By:   christos
Date:           Fri Feb 15 00:29:45 UTC 2013

Modified Files:
        src/usr.bin/vis: vis.c

Log Message:
More fixes from J.R. Oldroyd:

- I have added a call to memset() to clear the mbibuff on
  each loop.  Since we're dealing with possibly broken
  multibyte sequences, clearing it will avoid problems with
  a new input sequence possibly being confused by extra
  bytes still there from the last iteration.  wctomb(),
  which is used to fill that buffer, does not append a NUL.

- I have added a (char) cast when copying single bytes into
  the input buffer after a multibyte conversion error.

- In the call to strvisx() the count must be 1, not mbilen
  which can be 2 or 3 etc for a multibyte character.  This
  value is a count of characters - not bytes - to process.
  It even says characters in the man page.  In vis(3) I
  am interpreting this value to mean multibyte characters.

To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/vis/vis.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Home | Main Index | Thread Index | Old Index