diff options
author | Mike Wadsten <mikewadsten@gmail.com> | 2016-04-10 18:52:57 -0500 |
---|---|---|
committer | Mike Wadsten <mikewadsten@gmail.com> | 2016-04-10 19:11:17 -0500 |
commit | 80471df2089201e9bac852cda7d46a04e18e0e5a (patch) | |
tree | 421fbc476701e5f2b9b20de710b36c2ef01d35a3 | |
parent | 91c5005da82e6f9ab6bb2f46b27cb82b188b0391 (diff) | |
download | rneovim-80471df2089201e9bac852cda7d46a04e18e0e5a.tar.gz rneovim-80471df2089201e9bac852cda7d46a04e18e0e5a.tar.bz2 rneovim-80471df2089201e9bac852cda7d46a04e18e0e5a.zip |
cscope: Fix mismatched types in ':cscope show' output
Type long on 32-bit systems is typically 32 bits, but
PRId64 is 64 bits. This mismatch leads to bad output
or segfaults on :cs show.
Fixes #4537
-rw-r--r-- | src/nvim/if_cscope.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c index 7169a1d963..a143490356 100644 --- a/src/nvim/if_cscope.c +++ b/src/nvim/if_cscope.c @@ -2081,12 +2081,13 @@ static int cs_show(exarg_T *eap) if (csinfo[i].fname == NULL) continue; - if (csinfo[i].ppath != NULL) - (void)smsg("%2zu %-5" PRId64 " %-34s %-32s", - i, (long)csinfo[i].pid, csinfo[i].fname, csinfo[i].ppath); - else - (void)smsg("%2zu %-5" PRId64 " %-34s <none>", - i, (long)csinfo[i].pid, csinfo[i].fname); + if (csinfo[i].ppath != NULL) { + (void)smsg("%2zu %-5" PRId64 " %-34s %-32s", i, + (int64_t)csinfo[i].pid, csinfo[i].fname, csinfo[i].ppath); + } else { + (void)smsg("%2zu %-5" PRId64 " %-34s <none>", i, + (int64_t)csinfo[i].pid, csinfo[i].fname); + } } } |