From 80471df2089201e9bac852cda7d46a04e18e0e5a Mon Sep 17 00:00:00 2001 From: Mike Wadsten Date: Sun, 10 Apr 2016 18:52:57 -0500 Subject: 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 --- src/nvim/if_cscope.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src') 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 ", - 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 ", i, + (int64_t)csinfo[i].pid, csinfo[i].fname); + } } } -- cgit