comparison src/digraph.c @ 20751:d9a2e5dcfd9f v8.2.0928

patch 8.2.0928: many type casts are used for vim_strnsave() Commit: https://github.com/vim/vim/commit/df44a27b53586fccfc6a3aedc89061fdd9a515ff Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 7 20:49:05 2020 +0200 patch 8.2.0928: many type casts are used for vim_strnsave() Problem: Many type casts are used for vim_strnsave(). Solution: Make the length argument size_t instead of int. (Ken Takata, closes #5633) Remove some type casts.
author Bram Moolenaar <Bram@vim.org>
date Sun, 07 Jun 2020 21:00:03 +0200
parents 3a68dc2a1bc1
children bb3f60b0aca0
comparison
equal deleted inserted replaced
20750:020a100bfa92 20751:d9a2e5dcfd9f
2385 p = skipwhite(line); 2385 p = skipwhite(line);
2386 if (*p != '"' && *p != NUL && ga_grow(&curbuf->b_kmap_ga, 1) == OK) 2386 if (*p != '"' && *p != NUL && ga_grow(&curbuf->b_kmap_ga, 1) == OK)
2387 { 2387 {
2388 kp = (kmap_T *)curbuf->b_kmap_ga.ga_data + curbuf->b_kmap_ga.ga_len; 2388 kp = (kmap_T *)curbuf->b_kmap_ga.ga_data + curbuf->b_kmap_ga.ga_len;
2389 s = skiptowhite(p); 2389 s = skiptowhite(p);
2390 kp->from = vim_strnsave(p, (int)(s - p)); 2390 kp->from = vim_strnsave(p, s - p);
2391 p = skipwhite(s); 2391 p = skipwhite(s);
2392 s = skiptowhite(p); 2392 s = skiptowhite(p);
2393 kp->to = vim_strnsave(p, (int)(s - p)); 2393 kp->to = vim_strnsave(p, s - p);
2394 2394
2395 if (kp->from == NULL || kp->to == NULL 2395 if (kp->from == NULL || kp->to == NULL
2396 || STRLEN(kp->from) + STRLEN(kp->to) >= KMAP_LLEN 2396 || STRLEN(kp->from) + STRLEN(kp->to) >= KMAP_LLEN
2397 || *kp->from == NUL || *kp->to == NUL) 2397 || *kp->from == NUL || *kp->to == NUL)
2398 { 2398 {