Age | Commit message (Collapse) | Author |
|
Problem: is*() and to*() function may be unsafe
Solution: Add SAFE_* macros and start using those instead
(Keith Thompson)
Use SAFE_() macros for is*() and to*() functions
The standard is*() and to*() functions declared in <ctype.h> have
undefined behavior for negative arguments other than EOF. If plain char
is signed, passing an unchecked value from argv for from user input
to one of these functions has undefined behavior.
Solution: Add SAFE_*() macros that cast the argument to unsigned char.
Most implementations behave sanely for negative arguments, and most
character values in practice are non-negative, but it's still best
to avoid undefined behavior.
The change from #13347 has been omitted, as this has already been
separately fixed in commit ac709e2fc0db6d31abb7da96f743c40956b60c3a
(v9.0.2054)
fixes: #13332
closes: #13347
Signed-off-by: Keith Thompson <Keith.S.Thompson@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: "clear" macros are not always used.
Solution: Use ALLOC_ONE, VIM_CLEAR, CLEAR_POINTER and CLEAR_FIELD in more
places. (Yegappan Lakshmanan, closes #12104)
|
|
Problem: Handling new value of an option has a long "else if" chain.
Solution: Use a function pointer. (Yegappan Lakshmanan, closes #12015)
|
|
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes #11792)
|
|
Problem: Handling 'statusline' errors is spread out.
Solution: Pass the option name to the lower levels so the option can be
reset there when an error is encountered. (Luuk van Baal,
closes #11467)
|
|
Problem: No support for double, dotted and dashed underlines.
Solution: Add the termcap entries and highlight modes. (closes #9553)
|
|
Problem: The EBCDIC support is outdated.
Solution: Remove the EBCDIC support.
|
|
Problem: Theoretical computation overflow.
Solution: Perform multiplication in a wider type. (closes #9657)
|
|
Problem: Using int for second argument of ga_init2().
Solution: Remove unnessary type cast (int) when using sizeof().
|
|
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
|
|
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
|
|
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
|
|
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
|
|
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
|
|
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
|
|
Problem: Error messages are spread out.
Solution: Move more errors to errors.h.
|
|
Problem: Some type casts are not needed.
Solution: Remove unnecessary type casts. (closes #8934)
|
|
Problem: Computing array length is done in various ways.
Solution: Use ARRAY_LENGTH everywhere. (Ken Takata, closes #8305)
|
|
Problem: Clearing a struct is verbose.
Solution: Define and use CLEAR_FIELD() and CLEAR_POINTER().
|
|
Problem: Using old C style comments.
Solution: Use // comments where appropriate.
|
|
Problem: Alloc() returning "char_u *" causes a lot of type casts.
Solution: Have it return "void *". (Mike Williams) Define ALLOC_ONE() to
check the simple allocations.
|
|
Problem: Warnings for using localtime() and ctime().
Solution: Use localtime_r() if available. Avoid using ctime().
|
|
Problem: Too many #ifdefs.
Solution: Graduate FEAT_MBYTE, part 2.
|
|
Problem: Argument for message functions is inconsistent.
Solution: Make first argument to msg() "char *".
|
|
Problem: Giving error messages is not flexible.
Solution: Add semsg(). Change argument from "char_u *" to "char *", also
for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes
#3302) Also make emsg() accept a "char *" argument. Get rid of
an enormous number of type casts.
|
|
Problem: Unnecessary static function prototypes.
Solution: Remove unnecessary prototypes.
|
|
Problem: All tab stops are the same.
Solution: Add the variable tabstop feature. (Christian Brabandt,
closes #2711)
|
|
Problem: Crash when using :hardcopy with illegal byte.
Solution: Check for string_convert() returning NULL. (Dominique Pelle)
|
|
Problem: Access memory beyond end of string. (Coverity)
Solution: Keep allocated memory in separate pointer. Avoid outputting the
NUL character.
|
|
Problem: Clearing a pointer takes two lines.
Solution: Add VIM_CLEAR() and replace vim_clear(). (Hirohito Higashi,
closes #2629)
|
|
Problem: There are still a few macros that should be all-caps.
Solution: Make a few more macros all-caps.
|
|
Problem: Modelines in source code are inconsistant.
Solution: Use the same line in most files. Add 'noet'. (Naruhiko Nishino)
|
|
Problem: 'guicolors' is a confusing option name.
Solution: Use 'termguicolors' instead. (Hirohito Higashi)
|
|
Problem: Cannot use true color in the terminal.
Solution: Add the 'guicolors' option. (Nikolai Pavlov)
|
|
Problem: Using freed memory when parsing 'printoptions' fails.
Solution: Save the old options and restore them in case of an error.
(Dominique)
|
|
Problem: ":colorscheme" does not use 'packpath'.
Solution: Also use in "start" and "opt" directories in 'packpath'.
|
|
Problem: Using old style function declarations.
Solution: Change to new style function declarations. (script by Hirohito
Higashi)
|
|
Problem: Still using __ARGS.
Solution: Remove __ARGS in several files. (script by Hirohito Higashi)
Also remove use of HAVE_STDARG_H.
|
|
Problem: Compiler warning for using uninitialized variable. (Yasuhiro
Matsumoto)
Solution: Initialize it.
|
|
Problem: Out-of-bounds read, dectected by Coverity.
Solution: Remember the value of cmap for the first matching encoding. Reset
cmap to that value if first matching encoding is going to be used.
(Eliseo MartÃnez)
|
|
Problem: When starting several Vim instances in diff mode, the temp files
used may not be unique. (Issue 353)
Solution: Add an argument to vim_tempname() to keep the file.
|
|
Problem: ":hardcopy" leaks memory in case of errors.
Solution: Free memory in all code paths. (Christian Brabandt)
|
|
Problem: Typos in source files.
Solution: Fix the typos. (Ken Takata)
|
|
Problem: Items on the stack may be too big.
Solution: Make items static or allocate them.
|
|
Problem: Unsafe string copying.
Solution: Use vim_strncpy() instead of strcpy(). Use vim_strcat() instead
of strcat().
|
|
|
|
|
|
A few minor changes.
|
|
|
|
|