Preventing valid pointers from getting truncated and rejected.
Patch by Mike Frysinger, tweaked by Benno. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5508 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
277f58f8d8
commit
1bebe34b56
|
@ -4,6 +4,9 @@
|
||||||
* src/files.c (save_history, save_poshistory): Don't make the user
|
* src/files.c (save_history, save_poshistory): Don't make the user
|
||||||
hit Enter when there's an error saving history state at exit; it is
|
hit Enter when there's an error saving history state at exit; it is
|
||||||
pointless and annoying. Just notify the user and move on.
|
pointless and annoying. Just notify the user and move on.
|
||||||
|
* src/nano.c (main): On most 64-bit systems, casting a pointer to
|
||||||
|
an integer can cause valid pointers to be truncated and rejected.
|
||||||
|
Rework the code to test for the two invalid values directly.
|
||||||
|
|
||||||
2015-12-23 Christian Weisgerber <naddy@mips.inka.de>
|
2015-12-23 Christian Weisgerber <naddy@mips.inka.de>
|
||||||
* configure.ac: AC_CHECK_HEADERS_ONCE() is very special and cannot be
|
* configure.ac: AC_CHECK_HEADERS_ONCE() is very special and cannot be
|
||||||
|
|
11
src/nano.c
11
src/nano.c
|
@ -2574,11 +2574,14 @@ int main(int argc, char **argv)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(NANO_TINY) && defined(HAVE_KEY_DEFINED)
|
#if !defined(NANO_TINY) && defined(HAVE_KEY_DEFINED)
|
||||||
|
const char *keyvalue;
|
||||||
/* Ask ncurses for the key codes for Control+Left and Control+Right. */
|
/* Ask ncurses for the key codes for Control+Left and Control+Right. */
|
||||||
if ((int)tigetstr("kLFT5") > 0)
|
keyvalue = tigetstr("kLFT5");
|
||||||
controlleft = key_defined(tigetstr("kLFT5"));
|
if (keyvalue != 0 && keyvalue != (char *)-1)
|
||||||
if ((int)tigetstr("kRIT5") > 0)
|
controlleft = key_defined(keyvalue);
|
||||||
controlright = key_defined(tigetstr("kRIT5"));
|
keyvalue = tigetstr("kRIT5");
|
||||||
|
if (keyvalue != 0 && keyvalue != (char *)-1)
|
||||||
|
controlright = key_defined(keyvalue);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
Loading…
Reference in New Issue