File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -237,18 +237,19 @@ msg_strtrunc(
237237trunc_string (
238238 char_u * s ,
239239 char_u * buf ,
240- int room ,
240+ int room_in ,
241241 int buflen )
242242{
243- int half ;
244- int len ;
243+ size_t room = room_in - 3 ; /* "..." takes 3 chars */
244+ size_t half ;
245+ size_t len = 0 ;
245246 int e ;
246247 int i ;
247248 int n ;
248249
249- room -= 3 ;
250+ if (room_in < 3 )
251+ room = 0 ;
250252 half = room / 2 ;
251- len = 0 ;
252253
253254 /* First part: Start of the string. */
254255 for (e = 0 ; len < half && e < buflen ; ++ e )
@@ -320,7 +321,7 @@ trunc_string(
320321 if (s != buf )
321322 {
322323 len = STRLEN (s );
323- if (len >= buflen )
324+ if (len >= ( size_t ) buflen )
324325 len = buflen - 1 ;
325326 len = len - e + 1 ;
326327 if (len < 1 )
@@ -333,8 +334,8 @@ trunc_string(
333334 {
334335 /* set the middle and copy the last part */
335336 mch_memmove (buf + e , "..." , (size_t )3 );
336- len = ( int ) STRLEN (s + i ) + 1 ;
337- if (len >= buflen - e - 3 )
337+ len = STRLEN (s + i ) + 1 ;
338+ if (len >= ( size_t ) buflen - e - 3 )
338339 len = buflen - e - 3 - 1 ;
339340 mch_memmove (buf + e + 3 , s + i , len );
340341 buf [e + 3 + len - 1 ] = NUL ;
Original file line number Diff line number Diff line change @@ -758,6 +758,8 @@ static char *(features[]) =
758758
759759static int included_patches [] =
760760{ /* Add new patch number below this line */
761+ /**/
762+ 2097 ,
761763/**/
762764 2096 ,
763765/**/
You can’t perform that action at this time.
0 commit comments