mirror of
git://git.sv.gnu.org/nano.git
synced 2025-01-09 03:02:27 +03:00
tweaks: avoid a comparison between signed and unsigned [coverity]
This commit is contained in:
parent
2307b31887
commit
1861052234
@ -89,7 +89,7 @@ int shiftaltleft, shiftaltright, shiftaltup, shiftaltdown;
|
||||
#ifdef ENABLED_WRAPORJUSTIFY
|
||||
ssize_t fill = -COLUMNS_FROM_EOL;
|
||||
/* The relative column where we will wrap lines. */
|
||||
ssize_t wrap_at = 0;
|
||||
size_t wrap_at = 0;
|
||||
/* The actual column where we will wrap lines, based on fill. */
|
||||
#endif
|
||||
|
||||
|
@ -649,11 +649,12 @@ void window_init(void)
|
||||
|
||||
#ifdef ENABLED_WRAPORJUSTIFY
|
||||
/* Set up the wrapping point, accounting for screen width when negative. */
|
||||
wrap_at = fill;
|
||||
if (wrap_at <= 0)
|
||||
wrap_at += COLS;
|
||||
if (wrap_at < 0)
|
||||
if (COLS + fill < 0)
|
||||
wrap_at = 0;
|
||||
else if (fill <= 0)
|
||||
wrap_at = COLS + fill;
|
||||
else
|
||||
wrap_at = fill;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,8 @@ extern int shiftaltup, shiftaltdown;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLED_WRAPORJUSTIFY
|
||||
extern ssize_t fill, wrap_at;
|
||||
extern ssize_t fill;
|
||||
extern size_t wrap_at;
|
||||
#endif
|
||||
|
||||
extern char *last_search;
|
||||
|
Loading…
Reference in New Issue
Block a user