aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/strings.c
Commit message (Collapse)AuthorAge
* vim-patch:8.1.2083: multi-byte chars do not work properly with "%.*S" in ↵Daniel Hahler2019-09-28
| | | | | | | printf() (#11106) Problem: Multi-byte chars do not work properly with "%.*S" in printf(). Solution: Use mb_ptr2cells(). Daniel Hahler, closes vim/vim#4989) https://github.com/vim/vim/commit/ce0fac28977af31f1dec411d3535b4de2c3169b3
* vim-patch:8.0.0709: libvterm cannot use vsnprintf()Jan Edmund Lazo2019-04-04
| | | | | | Problem: Libvterm cannot use vsnprintf(), it does not exist in C90. Solution: Use vim_vsnprintf() instead. https://github.com/vim/vim/commit/8327d1df1754b33d8a93b3411f30692f0042f4ce
* build: Fix -Wconversion warnings for fpclassify et alJustin M. Keyes2019-01-21
| | | | | | | | | | | | closes #8274 The parent commit tries a different approach, but that fails on Apple Clang version: Apple LLVM version 10.0.0 (clang-1000.11.45.5) Target: x86_64-apple-darwin17.7.0 which somehow compiles the check_c_source_compiles() check, but then complains during later compilation that __fpclassify is not defined (regardless of "#include <math.h>").
* build: Fix -Wconversion warnings for fpclassify et alJustin M. Keyes2019-01-20
| | | | | | | | | | | | closes #8274 - Instead of #undef and re-#define, define "xfoo" wrappers to avoid include-order sensitivity. - The warnings are bogus, caused by bad interaction between glibc and clang 6+. - https://bugs.llvm.org/show_bug.cgi?id=35268 - https://bugs.llvm.org/show_bug.cgi?id=39738 - https://bugzilla.redhat.com/show_bug.cgi?id=1472437
* strings: make vim_snprintf handle %d correctly againBjörn Linse2018-12-24
| | | | This was broken in #9369 (4680ca2)
* strings: use (u)int16_t for %h printf formatJan Edmund Lazo2018-12-16
|
* add func_attr_printf in :MichaHoffmann2018-09-24
| | | | | | | | | | | | | | | | | | | | | | log.c message.c strings.c fixed some printf warnings in: src/nvim/undo.c src/nvim/eval.c src/nvim/eval/encode.c src/nvim/eval/typval.c src/nvim/ex_getln.c src/nvim/fileio.c src/nvim/lua/executor.c src/nvim/main.c src/nvim/regexp_nfa.c src/nvim/shada.c src/nvim/spellfile.c src/nvim/tui/terminfo.c src/nvim/garray.h
* vim-patch:8.0.1468: illegal memory access in del_bytes()Jan Edmund Lazo2018-08-24
| | | | | | Problem: Illegal memory access in del_bytes(). Solution: Check for negative byte count. (Christian Brabandt, closes vim/vim#2466) https://github.com/vim/vim/commit/191f18bad0b5c48afa05c3e8a00f3ced993f6a38
* Merge #8833 from janlazo/vim-8.0.1004Justin M. Keyes2018-08-12
|\
| * vim-patch:8.0.1421: accessing invalid memory with overlong byte sequenceJan Edmund Lazo2018-08-09
| | | | | | | | | | | | Problem: Accessing invalid memory with overlong byte sequence. Solution: Check for NUL character. (test by Dominique Pelle, closes vim/vim#2485) https://github.com/vim/vim/commit/e6640ad44e2186bd3642b972115496d347cd1fdd
* | refactor: Replace vim_strrchr() with strrchar() (#8718)ZviRackover2018-08-11
|/ | | | ref #1474
* vim-patch:8.0.0451: some macros are in lower caseJan Edmund Lazo2018-06-12
| | | | | | | Problem: Some macros are in lower case. Solution: Make a few more macros upper case. Avoid lower case macros use an argument twice. https://github.com/vim/vim/commit/91acfffc1e6c0d8c2abfb186a0e79a5bf19c3f3f
* strings.c: Fix PVS/V781: value of 'l + 1' is checked after it was usedJustin M. Keyes2018-05-20
|
* strings: Fix PVS/V547: condition already checked by surrounding ifZyX2018-04-22
|
* strings: Fix PVS/V779: wrong assert() positionZyX2018-04-22
|
* Fix for lintGeorge Zhao2018-01-19
|
* Fix warning about math functions, include isnan, isinf, fpclassify.George Zhao2018-01-18
|
* strings/tv_float: Explicitly cast v_number to float_T for -WconversionJames McCoy2017-06-06
|
* vim-patch:7.4.2029James McCoy2017-06-04
| | | | | | | Problem: printf() does not work with 64 bit numbers. Solution: use the "L" length modifier. (Ken Takata) https://github.com/vim/vim/commit/38ee6b041e73ad31c3b6b99d56d20833b59b2b57
* strings: Return NUL from vim_strchr for invalid inputZyX2017-05-09
|
* Merge #6460 from ZyX-I/1476-changesJustin M. Keyes2017-05-08
|\ | | | | Refactor functions which find character in a string
| * Merge branch 'master' into 1476-changesZyX2017-04-10
| |\
| * | strings: Remove vim_strbyteZyX2017-04-07
| | | | | | | | | | | | Ref #1476
| * | strings: Replace vim_strchr implementation with a saner oneZyX2017-04-07
| | | | | | | | | | | | | | | | | | | | | | | | Removes dead code (enc_utf8, enc_dbcs and has_mbyte now have hardcoded values), relies on libc implementation being more optimized. Also where previously negative character just would never be found it is an assertion error now. Ref #1476
* | | *: Add comment to all C filesZyX2017-04-19
| | |
* | | win: vim_strsave_shellescape: Handle 'shellslash'.Justin M. Keyes2017-04-12
| |/ |/| | | | | From Vim, misc2.c:vim_strsave_shellescape
* | vim-patch:8.0.0243Björn Linse2017-04-10
| | | | | | | | | | | | | | | | | | | | | | Problem: When making a character lower case with tolower() changes the byte cound, it is not made lower case. Solution: Add strlow_save(). (Dominique Pelle, closes vim/vim#1406) https://github.com/vim/vim/commit/cc5b22b3bfdc0e9e835cf7871166badda31447bd Join almost identical strup_save and strlow_save functions to one Function.
* | mbyte: replace vim_tolower with mb_tolower handling locale correctlyBjörn Linse2017-04-10
|/
* eval: Move remaining get_tv_string* functions to eval/typval.cZyX2017-03-29
|
* eval: Move get_tv_number[_chk] to eval/typval.cZyX2017-03-29
|
* eval,*: Move get_tv_string to typval.cZyX2017-03-29
| | | | Function was renamed and changed to return `const char *`.
* eval: Split eval.c into smaller filesZyX2017-03-29
|
* vim_vsnprintf: fix conversion warning #6333John Szakmeister2017-03-22
| | | | Re-apply fix from #6311 which was accidentally regressed in #6231.
* strings: Fix problems found during code reviewJurica Bradaric2017-03-21
|
* vim-patch:7.4.2291Jurica Bradaric2017-03-20
| | | | | | | Problem: printf() handles floats wrong when there is a sign. Solution: Fix placing the sign. Add tests. (Dominique Pelle) https://github.com/vim/vim/commit/04186095346daa60e82e981dad114de2b641d672
* vim-patch:7.4.2280Jurica Bradaric2017-03-20
| | | | | | | Problem: printf() doesn't handle infinity float values correctly. Solution: Add a table with possible infinity values. (Dominique Pelle) https://github.com/vim/vim/commit/e999782e369999539a1783a7ebe4eadcc6da28a8
* vim-patch:7.4.2266Jurica Bradaric2017-03-20
| | | | | | | | Problem: printf() test fails on Windows. "-inf" is not used. Solution: Check for Windows-specific values for "nan". Add sign to "inf" when appropriate. https://github.com/vim/vim/commit/9992237a3e791fbc0c1ebf743ece1b75e1488410
* vim_vsnprintf: fix conversion error #6311John Szakmeister2017-03-18
| | | | | | This looks mostly like a case where the compiler that ships with Ubuntu 12.04 has gone a little too far: `fmt_spec` is actually a char, as are the literals, so there's really no issue.
* vim-patch:7.4.2292 (#6304)Jack Bracewell2017-03-17
| | | | | | Problem: Not all systems understand %F in printf(). Solution: Use %f. https://github.com/vim/vim/commit/965ed14973fd3f1b2aace7bae4d4722b71ca04f9
* strings.c: Fix problems found during code review.Jurica Bradaric2017-03-06
|
* vim-patch:7.4.2220Jurica Bradaric2017-03-06
| | | | | | | | Problem: printf() gives an error when the argument for %s is not a string. (Ozaki Kiichi) Solution: Behave like invoking string() on the argument. (Ken Takata) https://github.com/vim/vim/commit/e5a8f35b4286135f3469f3b00a6c2220553d9658
* strings.c: remove unused assignmentJente Hidskes2017-02-20
| | | | | As reported by clang-scan, `length_modifier` is never read in any code path following this branch. It is safe to remove.
* string.c: Include <stdarg.h> for va_list type and va_* macrosJames McCoy2017-02-19
| | | | Closes #6141
* Merge #6110 'refactor: Move vim_*printf to strings.c'.Justin M. Keyes2017-02-17
|\
| * strings: Fix “unexpected format specifier: %lp” ASAN errorZyX2017-02-15
| |
| * message,strings: Move vim_*printf functions to strings.cZyX2017-02-14
|/ | | | Allows eval/typval.h to #include message.h.
* refactor: Remove strncpy/STRNCPY. (#6008)Justin M. Keyes2017-01-26
| | | | | | | | | | | | | | | Closes #731 References #851 Note: This does not remove some intentional legacy usages of strncpy. - memcpy isn't equivalent because it doesn't check the string length of `src`, and doesn't zero-out the remainder of `dst`. - xstrlcpy isn't equivalent because it doesn't zero-out the remainder of `dst`. Some Vim logic depends on that (e.g. ex_append which calls vim_strnsave). Helped-by: Douglas Schneider <ds3@ualberta.ca> Helped-by: oni-link <knil.ino@gmail.com> Helped-by: James McCoy <jamessan@jamessan.com>
* refactor: Replace vim_strcat() with xstrlcat().Justin M. Keyes2017-01-23
|
* refactor: eliminate misc2.cJustin M. Keyes2016-09-13
| | | | | | | | | | move `call_shell` to misc1.c Move some fns to state.c Move some fns to option.c Move some fns to memline.c Move `vim_chdir*` fns to file_search.c Move some fns to new module, bytes.c Move some fns to fileio.c
* strings: Change order of operands in condition.Jurica Bradaric2016-01-24
| | | | utf_ptr2char only needs to be called for l > 1.